Skip to content

Conversation

@alkatrivedi
Copy link
Contributor

@alkatrivedi alkatrivedi commented Oct 31, 2025

This PR contains code changes for making multiplexed session as default enabled session mode.

To disable the multiplexed session:
For RO Transactions -
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS = 'false'

For Partitioned DML -

GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS = 'false'
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS = 'false'

For RW Transactions -

GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS = 'false'
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW = 'false'

Additionally, this PR includes code changes in the kokoro pipeline to run the integration test against regular sessions.

@alkatrivedi alkatrivedi requested review from a team as code owners October 31, 2025 06:31
@alkatrivedi alkatrivedi marked this pull request as draft October 31, 2025 06:31
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Oct 31, 2025
@alkatrivedi alkatrivedi force-pushed the mux-default-enabled branch 3 times, most recently from 3bdd009 to e3ab09e Compare November 5, 2025 04:04
@alkatrivedi alkatrivedi added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 5, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@generated-files-bot
Copy link

Warning: This pull request is touching the following templated files:

  • .kokoro/presubmit/node18/system-test-regular-session.cfg - .kokoro files are templated and should be updated in synthtool

@alkatrivedi alkatrivedi force-pushed the mux-default-enabled branch 3 times, most recently from e28ae67 to eb48211 Compare November 5, 2025 08:39
@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
}
},
);
// awaiting 10ms for begin call to finish its execution
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are not awaiting on begin in createReadStream(known issue) to finish its execution, which was resulting in beginTxnRequest to be undefined. hence having this 10ms of sleep

*/
async _acquire(): Promise<Session | null> {
const span = getActiveOrNoopSpan();
span.addEvent('Acquiring multiplexed session');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have added these events for multiplexed session similar to we had for regular sessions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel these events are not required. For regular session it was required as there was a wait if the session is not available. We already have few events in _getSession for mux sessions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
@alkatrivedi alkatrivedi added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 5, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 5, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 5, 2025
@alkatrivedi alkatrivedi marked this pull request as ready for review November 6, 2025 04:34
@alkatrivedi alkatrivedi added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Nov 6, 2025
*/
async _acquire(): Promise<Session | null> {
const span = getActiveOrNoopSpan();
span.addEvent('Acquiring multiplexed session');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I feel these events are not required. For regular session it was required as there was a wait if the session is not available. We already have few events in _getSession for mux sessions

const error = new Error('err');

const sessionFactory = new SessionFactory(database, NAME);
describe('when multiplexed session is disabled', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we decided to remove these tests to remove the complexity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've refactored the tests to focus on the default multiplexed mode and removed the complex env enable/disable permutation loops.

For the regular session-specific tests, we can just run them with GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS disabled. Since we aren't running the full matrix of env permutations anymore. IMO we can retain this test. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Make sure to verify if we are reverting the ENVs in after block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that I have made sure!

@alkatrivedi alkatrivedi added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Nov 11, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Nov 11, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 11, 2025
@alkatrivedi alkatrivedi merged commit 9ef0565 into main Nov 11, 2025
22 of 25 checks passed
@alkatrivedi alkatrivedi deleted the mux-default-enabled branch November 11, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/nodejs-spanner API. do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants