Skip to content
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

Change request tags to a combination of transaction tags + sequence num + SQL text. #142

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

takabow
Copy link
Contributor

@takabow takabow commented Nov 10, 2022

spanner-cli has embedded in the request tag the same thing as the transaction tag. However, Cloud Spanner groups queries with the same request tag in query stats as the same. Therefore, to make it easier to identify individual queries issued by spanner-cli in query stats, the request tag has been changed to be transaction tags + sequential number + SQL text.

This PR fix #132.

iter := s.tc.rwTxn.QueryWithOptions(ctx, stmt, opts)
s.tc.sendHeartbeat = true
return iter, nil
}
if s.InReadOnlyTransaction() {
opts.RequestTag = s.tc.tag
opts.RequestTag = generateRequestTag(s.tc, stmt)
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 noticed that SHOW INDEX and SHOW COLUMNS fall into this section in a RO transaction. It should be fix.

@takabow takabow force-pushed the fix/change-request_tags-behavior branch from 9a67221 to fe7cb95 Compare February 27, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request tag(per-transaction vs. per-query?)
1 participant