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

Allow setting session id of KVTxn #1270

Merged
merged 4 commits into from
Apr 8, 2024
Merged

Conversation

ekexium
Copy link
Contributor

@ekexium ekexium commented Apr 7, 2024

Self-explained by the comment.

@ekexium ekexium requested review from cfzjywxk and you06 April 7, 2024 12:16
Signed-off-by: ekexium <[email protected]>
@@ -395,6 +395,22 @@ func (txn *KVTxn) SetTxnSource(txnSource uint64) {
txn.txnSource = txnSource
}

// SetSessionID sets the session ID of the transaction.
// If the committer is not initialized yet, the function won't take effect.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the concern of completeness of the API, do we consider put it to another field temporarily if the committer is not initialized yet, and use it lazily when initializing the committer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth consideration. But I don't want to do it now as it's not needed

@crazycs520
Copy link
Contributor

#908 Can this PR help?

@ekexium
Copy link
Contributor Author

ekexium commented Apr 8, 2024

#908 Can this PR help?

Yes. I tried to use ctx logger when possible. But it's not always feasible so SetSessionID is still needed for those cases.

@cfzjywxk cfzjywxk merged commit 7c70c54 into tikv:master Apr 8, 2024
10 checks passed
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.

5 participants