Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

feat: support multiplexed sessions for RO transactions - #3141

Merged
harshachinta merged 9 commits into
googleapis:mainfrom
harshachinta:mux-new-env-var
Jul 3, 2024
Merged

feat: support multiplexed sessions for RO transactions#3141
harshachinta merged 9 commits into
googleapis:mainfrom
harshachinta:mux-new-env-var

Conversation

@harshachinta

@harshachintaharshachinta commented May 30, 2024

Copy link
Copy Markdown
Contributor

With multiplexed sessions, the client optimizes and runs multiple applicable requests concurrently on a single session. A single multiplexed session is sufficient to handle all concurrent read-only traffic. Read/write transactions always use regular sessions.
This can be enabled through an environment variable GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS.

Session management behavior in Java client,

  1. GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS is set to true - Client uses multiplexed sessions.
  2. GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS is set to false - Client uses regular session cached in the session pool for running 1 concurrent transaction per session.
  3. GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS is not set - Client uses default session management mechanism which is using regular session cached in the session pool.

Note: Multiplexed sessions is unsupported when you use SpannerOption#enableGrpcGcpExtension. Enable multiplexed sessions when gRPC-GCP is unset.

@harshachinta
harshachinta requested review from a teamMay 30, 2024 10:31
@generated-files-bot

Copy link
Copy Markdown

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

  • .github/workflows/ci.yaml

@product-auto-labelproduct-auto-labelBot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels May 30, 2024
@harshachintaharshachinta added do not merge Indicates a pull request not ready for merge, due to either quality or timing. and removed api: spanner Issues related to the googleapis/java-spanner API. labels May 30, 2024
@harshachinta
harshachinta requested a review from arpan14May 30, 2024 10:49
@product-auto-labelproduct-auto-labelBot added the api: spanner Issues related to the googleapis/java-spanner API. label May 31, 2024
@harshachinta

Copy link
Copy Markdown
ContributorAuthor

@olavloite

Copy link
Copy Markdown
Collaborator

@harshachinta
harshachinta requested review from olavloite and removed request for arpan14 and olavloiteJune 24, 2024 11:53
@harshachintaharshachinta assigned arpan14 and unassigned arpan14Jun 24, 2024
@harshachintaharshachinta changed the title feat(spanner): environment variable to enable multiplexed sessionsfeat(spanner): support multiplexed sessions for RO transactionsJun 24, 2024
@olavloiteolavloite changed the title feat(spanner): support multiplexed sessions for RO transactionsfeat: support multiplexed sessions for RO transactionsJun 24, 2024
@harshachintaharshachinta added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 2, 2024
@gcf-owl-botgcf-owl-botBot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 2, 2024
@harshachintaharshachinta removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 3, 2024
@harshachinta
harshachinta merged commit 2b8e9ed into googleapis:mainJul 3, 2024
@release-pleaserelease-pleaseBot mentioned this pull request Jul 3, 2024
surbhigarg92 pushed a commit to surbhigarg92/java-spanner that referenced this pull request Jul 3, 2024
* feat(spanner): environment variable to enable multiplexed sessions
* chore: lint fix
* feat(spanner): add comment for gRPC-GCP
* feat(spanner): make strict check in env variable
* feat(spanner): add test
* feat(spanner): add test
* chore(spanner): lint
* 🦉 Updates from OwlBot post-processor
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
---------
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/java-spanner API.size: mPull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@harshachinta@olavloite@arpan14