Repository navigation
feat(datastore): add x-goog-is-transaction routing header - #9724
Open
nikhilchowdary wants to merge 3 commits into
Open
nikhilchowdary wants to merge 3 commits into
nikhilchowdary wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces logic to determine if a Datastore request is transactional and sets the x-goog-is-transaction header accordingly, along with comprehensive unit tests. The feedback suggests refining the transaction detection logic to correctly handle the enum representation of NON_TRANSACTIONAL in addition to its string value, and adding a corresponding test case to prevent regressions.
nikhilchowdary
force-pushed
the
feat/datastore-is-transaction-header
branch
3 times, most recently
from
October 26, 2026 08:52
47b64a2 to
42e3419
Compare
Adds the `x-goog-is-transaction: true` HTTP header to all transactional Datastore RPCs, ensuring proper routing of transactional requests. Changes: - Modified `prepareGaxRequest_` in `request.ts` to calculate `isTransactionHeader` based on the RPC method (`beginTransaction`, `rollback`, or `commit`, `runQuery`, etc.) and the transaction ID presence. - Appended the header `x-goog-is-transaction` to GAX options for all calls (set to `true` or `false`). - Added exhaustive unit tests in `request.ts` that verify the `x-goog-is-transaction` header behavior for both transactional and non-transactional RPC calls.
nikhilchowdary
force-pushed
the
feat/datastore-is-transaction-header
branch
from
October 26, 2026 09:21
42e3419 to
0ee4527
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 nodejs 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