-
Notifications
You must be signed in to change notification settings - Fork 123
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
chore(spanner): handle server side kill switch of R/W multiplexed sessions #3441
Merged
harshachinta
merged 10 commits into
googleapis:main
from
harshachinta:server-side-kill-switch-rw-mux
Nov 5, 2024
Merged
chore(spanner): handle server side kill switch of R/W multiplexed sessions #3441
harshachinta
merged 10 commits into
googleapis:main
from
harshachinta:server-side-kill-switch-rw-mux
Nov 5, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product-auto-label
bot
added
size: l
Pull request size is large.
api: spanner
Issues related to the googleapis/java-spanner API.
labels
Oct 30, 2024
olavloite
reviewed
Nov 1, 2024
...e-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java
Outdated
Show resolved
Hide resolved
...e-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java
Outdated
Show resolved
Hide resolved
...e-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java
Outdated
Show resolved
Hide resolved
...e-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/MockSpannerServiceImpl.java
Show resolved
Hide resolved
...r/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java
Show resolved
Hide resolved
olavloite
approved these changes
Nov 1, 2024
sakthivelmanii
pushed a commit
to sakthivelmanii/java-spanner
that referenced
this pull request
Nov 7, 2024
…sions (googleapis#3441) * chore(spanner): handle server side kill switch for multiplexed sessions with read-write * chore(spanner): lint fix * chore(spanner): add error message * chore(spanner): fix unit tests due to backgroung BeginTransaction RPC * chore(spanner): lint fix * chore(spanner): handle mock spanner logic * chore(spanner): testcase fix * chore(spanner): do not register backgroung begin txn in mock spanner * chore(spanner): revert unit test changes * chore(spanner): verify error message of the exeception
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following information apply only if:
On the backend, a server-side switch controls whether read-write transactions on multiplexed sessions are enabled. If this switch is disabled, all read-write transactions on multiplexed sessions will fail with UNIMPLEMENTED errors. This scenario is handled in the Java Spanner client as follows:
When the server-side switch is OFF before application start:
a. When the application starts, the Spanner client library asynchronously creates a multiplexed session.
b. After creating the multiplexed session, an asynchronous BeginTransaction RPC is explicitly invoked on a read-write transaction. If this call fails with an UNIMPLEMENTED error, the client disables read-write transactions on multiplexed sessions.
c. From this point, all new read-write transactions will fall back to regular sessions. However, any read-write transactions that started before this process completes will fail with an UNIMPLEMENTED error.
When the server-side switch is turned OFF at time t1 after the application has started at t0 (where t0 < t1):
a. If a read-write transaction fails with an UNIMPLEMENTED error, the Spanner client records this information and fails the transaction.
b. All subsequent read-write transactions then automatically fall back to regular sessions.
Note: This does not impact the behavior of read-only transactions on multiplexed sessions.