feat: support multiplexed sessions for RO transactions#3141
feat: support multiplexed sessions for RO transactions#3141harshachinta merged 9 commits intogoogleapis:mainfrom
Conversation
|
Warning: This pull request is touching the following templated files:
|
|
@harshachinta |
@harshachinta No, it's not a blocker. All of it is dead code, due to the static |
* 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>
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,
GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONSis set totrue- Client uses multiplexed sessions.GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONSis set tofalse- Client uses regular session cached in the session pool for running 1 concurrent transaction per session.GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONSis 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.