Skip to content

feat(spanner): add support of multiplexed session support in writeAtleastOnce mutations#10646

Merged
rahul2393 merged 4 commits intomainfrom
add_blind_write_mux_support
Aug 7, 2024
Merged

feat(spanner): add support of multiplexed session support in writeAtleastOnce mutations#10646
rahul2393 merged 4 commits intomainfrom
add_blind_write_mux_support

Conversation

@rahul2393
Copy link
Copy Markdown
Contributor

@rahul2393 rahul2393 commented Aug 7, 2024

  • This PR add support of using Multiplexed session if enabled with client.Apply(context.Background(), {mutations}, spanner.ApplyAtLeastOnce())

@rahul2393 rahul2393 requested review from a team August 7, 2024 06:37
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Aug 7, 2024
@rahul2393 rahul2393 changed the title feat(spanner): add support of multiplexed session support in mutations feat(spanner): add support of multiplexed session support in writeAtleastOnce mutations Aug 7, 2024
if sh == nil || sh.getID() == "" || sh.getClient() == nil {
// No usable session for doing the commit, take one from pool.
sh, err = t.sp.take(ctx)
sh, err = t.sp.takeMultiplexed(ctx)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume that it falls back to regular sessions in case there is an issue with multiplexed sessions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it will fallback to regular session, that logic is handled in takeMultiplexed because that behaviour is common

@harshachinta
Copy link
Copy Markdown
Contributor

harshachinta commented Aug 7, 2024

LGTM.
We are not adding a new environment variable to support multiplexed sessions in blind writes and instead when GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS is enabled it will automatically support blind writes also.

@rahul2393
Copy link
Copy Markdown
Contributor Author

LGTM.
One quick thought. I don't think we need a different environment variable to support multiplexed sessions in blind writes and instead when GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS is enabled it will automatically support blind writes also.

We are not using different env var

@rahul2393 rahul2393 merged commit 54009ea into main Aug 7, 2024
@rahul2393 rahul2393 deleted the add_blind_write_mux_support branch August 7, 2024 10:28
gcf-merge-on-green bot pushed a commit that referenced this pull request Aug 7, 2024
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 Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants