Repository navigation
feat(datastore): add x-goog-is-transaction routing header - #14767
Open
nikhilchowdary wants to merge 1 commit into
Open
nikhilchowdary wants to merge 1 commit into
nikhilchowdary wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces the 'x-goog-is-transaction' header to both gRPC and HTTP Datastore RPC implementations to indicate whether an RPC is part of a transaction. In GrpcDatastoreRpc, this is handled by passing specific ApiCallContext instances, while HttpDatastoreRpc utilizes a ThreadLocal to track and set the header dynamically. Comprehensive unit tests are also introduced to verify this header routing logic. The review feedback recommends extracting a private helper method isTransactionalRead in HttpDatastoreRpc to eliminate duplicate logic when checking if a read operation is transactional across the lookup, runQuery, and runAggregationQuery methods.
nikhilchowdary
force-pushed
the
feat/datastore-is-transaction-header
branch
from
October 25, 2026 07:14
5a1dff1 to
cf7244a
Compare
This commit attaches the `x-goog-is-transaction` routing header to all gRPC calls in the Cloud Datastore Java SDK (`GrpcDatastoreRpc`): - Set to `true` for transactional RPCs (`beginTransaction`, `rollback`, and transactional `commit`, `lookup`, `runQuery`, `runAggregationQuery`). - Set to `false` for non-transactional RPCs (`allocateIds`, `reserveIds`, and non-transactional `commit`, `lookup`, `runQuery`, `runAggregationQuery`).
nikhilchowdary
force-pushed
the
feat/datastore-is-transaction-header
branch
from
October 26, 2026 07:21
cf7244a to
a43c49e
Compare
This branch has not been deployed
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.
Add x-goog-is-transaction routing header in java SDK to differentiate transactional requests and non-transactional requests from each other. Having a routing header for transactions helps in routing grpc requests at GFE.
This commit attaches the
x-goog-is-transactionrouting header to all RPCsSet to true for transactional RPCs
--
beginTransaction--
rollback--
transactional commit--
transactional lookup--
transactional runQuery--
transactional runAggregationQuery.Set to false for non transactional RPCs
--
allocateIds--
non transactional commit--
non transactional lookup--
non transactional runQuery--
non transactional runAggregationQuery.cc: @MarkDuckworth