Skip to content

Conversation

sakthivelmanii
Copy link
Collaborator

Description:

Read-Write and Partition Ops transactions now use a single multiplexed session, instead of a session from the session pool. Multiplexed sessions can handle any number of queries and read-only, read-write and partition ops transactions transactions at the same time.

The use of multiplexed sessions can be disabled for read-write and partition-ops transactions by setting the environment variables.

GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_FOR_RW=false. GOOGLE_CLOUD_SPANNER_MULTIPLEXED_SESSIONS_PARTITIONED_OPS=false. 

See https://cloud.google.com/spanner/docs/sessions#multiplexed_sessions for more background information about multiplexed sessions.

@sakthivelmanii sakthivelmanii requested review from a team as code owners July 17, 2025 07:07
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Jul 17, 2025
@sakthivelmanii sakthivelmanii force-pushed the enable_multiplex_session_for_rw_partition_ops branch from e0b9f2f to 7bd0ac0 Compare July 17, 2025 07:08
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Jul 17, 2025
@sakthivelmanii sakthivelmanii added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 24, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 24, 2025
@sakthivelmanii sakthivelmanii force-pushed the enable_multiplex_session_for_rw_partition_ops branch from 544a358 to 682a3ab Compare July 28, 2025 16:09
rahul2393
rahul2393 previously approved these changes Jul 30, 2025
@sakthivelmanii sakthivelmanii force-pushed the enable_multiplex_session_for_rw_partition_ops branch from d5b2e8f to 055ab59 Compare July 31, 2025 06:51
@sakthivelmanii sakthivelmanii force-pushed the enable_multiplex_session_for_rw_partition_ops branch from bb4c7f0 to 6e648f9 Compare July 31, 2025 06:55
@sakthivelmanii sakthivelmanii merged commit a882204 into main Jul 31, 2025
42 checks passed
@sakthivelmanii sakthivelmanii deleted the enable_multiplex_session_for_rw_partition_ops branch July 31, 2025 08:35
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Jul 31, 2025
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-spanner](https://github.com/googleapis/java-spanner) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `6.97.1` -> `6.98.0` | --- ### Release Notes <details> <summary>googleapis/java-spanner (com.google.cloud:google-cloud-spanner)</summary> ### [`v6.98.0`](https://github.com/googleapis/java-spanner/blob/HEAD/CHANGELOG.md#6980-2025-07-31) ##### Features - Proto changes for an internal api ([675e90b](googleapis/java-spanner@675e90b)) - **spanner:** A new field `snapshot_timestamp` is added to message `.google.spanner.v1.CommitResponse` ([675e90b](googleapis/java-spanner@675e90b)) - Support Exemplar ([#&#8203;3997](googleapis/java-spanner#3997)) ([fcf0a01](googleapis/java-spanner@fcf0a01)) - Use multiplex sessions for RW and Partition Ops ([#&#8203;3996](googleapis/java-spanner#3996)) ([a882204](googleapis/java-spanner@a882204)) ##### Bug Fixes - **deps:** Update the Java code generator (gapic-generator-java) to 2.60.2 ([675e90b](googleapis/java-spanner@675e90b)) ##### Dependencies - Update dependency com.google.cloud:sdk-platform-java-config to v3.50.2 ([#&#8203;4004](googleapis/java-spanner#4004)) ([986c0e0](googleapis/java-spanner@986c0e0)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: e7253efcfa4f9166c7524a0c1ef8947662193d8d
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
backport fix from #4047 spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
Backport fix. spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token.
zhumin8 added a commit to GoogleCloudPlatform/spring-cloud-gcp that referenced this pull request Aug 19, 2025
Backport fix. spanner IT fails for `deleteAllById_doesNothingOnEmptyIds` test with error from Spanner: `INVALID_ARGUMENT: Failed to initialize transaction due to invalid mutation key.` **Trigger of this behavior change:** spanner activated multiplexed sessions by default in [googleapis/java-spanner#3996](googleapis/java-spanner#3996), which triggers this error. When issuing a write() with a Mutation that has an empty KeySet produces an exception in Multiplexed clients (see [pr](googleapis/java-spanner#4023)), but does a no-op in non-multiplexed ones. Unlike Regular session, multiplex session needs a valid mutation to generate a precommit token. Fixes #4046
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/java-spanner API. size: s Pull request size is small.

4 participants