Skip to content

feat: support read lock mode for R/W transactions #4010

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

Merged
merged 3 commits into from
Aug 18, 2025

Conversation

shobhitsg
Copy link
Contributor

Samples and integration tests will be added in separate PRs.

@shobhitsg shobhitsg requested review from a team as code owners August 5, 2025 09:25
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: spanner Issues related to the googleapis/java-spanner API. labels Aug 5, 2025
sakthivelmanii
sakthivelmanii previously approved these changes Aug 6, 2025
@sakthivelmanii sakthivelmanii added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 6, 2025
*
* <ul>
* <li>{@link ReadLockMode#PESSIMISTIC}: Read locks are acquired immediately on read. This mode
* primarily applies to transactions with {@code SERIALIZABLE} isolation.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this sentence mean?

This mode primarily applies to transactions with {@code SERIALIZABLE} isolation.

That it has no effect on RR? Or that it has a strong effect on Serializable?

What I'm aiming at is: Can we make this more concrete? As a customer, I would have no idea what this means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the doc. Currently, we do not allow setting the readLockMode for Repeatable Read(RR) isolation level and error will be returned. And by default, OPTIMISTIC lock mode will be used for RR.

@shobhitsg
Copy link
Contributor Author

@sakthivelmanii @olavloite: I've addressed the review comments. PTAL.

@olavloite olavloite added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2025
@olavloite olavloite added the automerge Merge the pull request once unit tests and other checks pass. label Aug 18, 2025
@gcf-merge-on-green gcf-merge-on-green bot merged commit 7d752d6 into googleapis:main Aug 18, 2025
55 of 57 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Aug 18, 2025
@shobhitsg shobhitsg deleted the read_lock_mode branch August 18, 2025 07:50
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: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants