kv: remove TxnCoordSender.PrepareRetryableError, rationalize ManualRestart#105109
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Jul 25, 2023
Merged
Conversation
Member
…start This commit cleans up the implementation of `GenerateForcedRetryableError` by removing the `TxnCoordSender.PrepareRetryableError` method and having the `TxnCoordSender.ManualRestart` return a retryable error. The cleanup also ensures that the `TxnCoordSender` is left in a `txnRetryableError` state after a `ManualRestart`, so that `Txn.PrepareForRetry` must be called before continuing to use the transaction. The goal with both of these changes is to close the gap between the handling of error-driven txn restarts and manual restarts. It also reworks the code to construct the retry error in the same place that "handles" the error, which is important for future changes that plan to add more context to retry errors. Release note: None Epic: None
8b8a1be to
fecca8d
Compare
Contributor
Author
|
This is preparatory cleanup for #105161, which is necessary for Read Committed. @arulajmani I assigned you as the primary reviewer. @lidorcarmel I assigned you as a secondary reviewer, given your prior work in this area which cleanup up so much of this and made #105161 remotely possible. |
arulajmani
approved these changes
Jul 24, 2023
Collaborator
arulajmani
left a comment
There was a problem hiding this comment.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @lidorcarmel)
Contributor
Author
|
TFTR! bors r+ |
Contributor
|
Timed out. |
Contributor
Author
|
bors r=arulajmani |
Contributor
|
Build succeeded: |
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 commit cleans up the implementation of
GenerateForcedRetryableErrorby removing theTxnCoordSender.PrepareRetryableErrormethod and having theTxnCoordSender.ManualRestartreturn a retryable error.The cleanup also ensures that the
TxnCoordSenderis left in atxnRetryableErrorstate after aManualRestart, so thatTxn.PrepareForRetrymust be called before continuing to use the transaction.The goal with both of these changes is to close the gap between the handling of error-driven txn restarts and manual restarts. It also reworks the code to construct the retry error in the same place that "handles" the error, which is important for future changes that plan to add more context to retry errors.
Release note: None
Epic: None