Support Transaction Tags and Request Tags#128
Merged
yfuruyama merged 4 commits intoApr 20, 2022
Conversation
yfuruyama
requested changes
Apr 18, 2022
Collaborator
|
Thank you @takabow for creating this change! PTAL the above comments. |
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.
This PR adds Cloud Spanner's transaction tags and request tags support to spanner-cli.
Transaction tags are tags set at the beginning of a transaction that makes the transaction identifiable. Request tags can be set for each request and identify individual requests.
According to this document, read-write transaction supports transaction tags and request tags. Read-only transaction only supports request tags.
So, I implemented this feature as follows.
Transaction Tags and Request Tags support in spanner-cli
In a read-write transaction, you can add arbitrary tags following
BEGIN RW TAG <tags>.spanner-cli adds the tags set in
BEGIN RW TAGas transaction tags.This tag will also be used as request tags within the transaction.
In a read-only transaction, you can add arbitrary tags following
BEGIN RO TAG <tags>.Since read-only transaction in Cloud Spanner doesn't support transaction tags, spanner-cli adds the tags set in
BEGIN RO TAGas request tags.