Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spanner): add support for Multiplexed Session for Read Only Tran… #2214

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

alkatrivedi
Copy link
Contributor

@alkatrivedi alkatrivedi commented Jan 9, 2025

This PR contains support for Multiplexed Session in all the RO methods, along with their tests.

The methods includes are:

  • getSnapshot
  • runStream
  • writeAtLeastOnce

@alkatrivedi alkatrivedi requested review from a team as code owners January 9, 2025 05:10
@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 Jan 9, 2025
gcf-owl-bot bot and others added 4 commits January 9, 2025 05:15
* chore(main): release 7.17.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: surbhigarg92 <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch 2 times, most recently from 8a256e0 to 7cf1d60 Compare January 9, 2025 05:26
@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2025
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 7cf1d60 to 9a85b93 Compare January 9, 2025 05:29
@alkatrivedi alkatrivedi added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 9, 2025
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 860bf28 to 47a9219 Compare January 9, 2025 06:14
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 9, 2025
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 47a9219 to 3a3d8c7 Compare January 9, 2025 06:41
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 3a3d8c7 to bc56399 Compare January 9, 2025 06:42
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from bc56399 to f477940 Compare January 9, 2025 06:43
@alkatrivedi alkatrivedi added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 9, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch 7 times, most recently from 000e144 to fa438fe Compare January 23, 2025 07:17
@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 Jan 23, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from fa438fe to 270cae3 Compare January 23, 2025 07:29
@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 Jan 23, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 23, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@surbhigarg92 surbhigarg92 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 23, 2025
Copy link
Contributor

@surbhigarg92 surbhigarg92 left a comment

Choose a reason for hiding this comment

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

Please share benchmarking results before merging

@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch 4 times, most recently from 6fe8379 to 7c4f371 Compare January 23, 2025 09:24

'use strict';

const muxEnabledTrue = [];
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 don't think you need to maintain two arrays here. You will either call this script with multiplexedEnabled as true or false. So only one will be used.

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, updated

}

async function runQueries() {
multiplexedEnabled === 'true'
Copy link
Contributor

Choose a reason for hiding this comment

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

Every thread is creating new Spanner instance, that would mean it will create a new mux session. So eventually we are running only one query at a time for one spanner client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for pointing this out, updated the client creation

@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 7c4f371 to de2c7ce Compare January 23, 2025 09:49
@alkatrivedi alkatrivedi force-pushed the multiplexed-session-support-read-only branch from 48814d8 to 995b31d Compare January 23, 2025 10:34
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. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants