fix: Transactions with readTime will omit begin and commit transaction requests, and instead pass readTime on individual read requests.#1565
Merged
tom-andersen merged 10 commits intomainfrom Feb 14, 2024
Conversation
readTime will omit begin and commit transaction requests, and instead pass readTime on individual read requests.
milaGGL
reviewed
Feb 12, 2024
google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java
Outdated
Show resolved
Hide resolved
milaGGL
reviewed
Feb 12, 2024
...le-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransactionRunner.java
Show resolved
Hide resolved
milaGGL
reviewed
Feb 12, 2024
...le-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransactionRunner.java
Show resolved
Hide resolved
milaGGL
reviewed
Feb 12, 2024
google-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransaction.java
Show resolved
Hide resolved
milaGGL
reviewed
Feb 12, 2024
google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java
Show resolved
Hide resolved
tom-andersen
commented
Feb 12, 2024
Contributor
Author
tom-andersen
left a comment
There was a problem hiding this comment.
Thanks for the feedback. I think I have addressed all points, and pushed up changes.
...le-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransactionRunner.java
Show resolved
Hide resolved
google-cloud-firestore/src/test/java/com/google/cloud/firestore/it/ITSystemTest.java
Show resolved
Hide resolved
...le-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransactionRunner.java
Show resolved
Hide resolved
google-cloud-firestore/src/main/java/com/google/cloud/firestore/ServerSideTransaction.java
Show resolved
Hide resolved
milaGGL
approved these changes
Feb 12, 2024
Contributor
milaGGL
left a comment
There was a problem hiding this comment.
LGTM, with one quick question. readTime is added for Query and AggregateQuery, what about single documents?
Contributor
Author
The proto doesn't support transaction or readTime on single get. Whenever transaction or readTime is required, we use batch get proto, even if it is for a single document. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Transactions with
readTimedo not need to begin and commit transaction. Instead, the individual requests can usereadTimeinstead oftransactionId. This will reduce latency when doing point in time reads.