kv: prioritize severe errors when merging partial batches in DistSender#38579
Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom Jul 1, 2019
Merged
Conversation
Member
andreimatei
approved these changes
Jul 1, 2019
Contributor
andreimatei
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @andreimatei and @nvanbenschoten)
pkg/roachpb/errors.go, line 42 at r2 (raw file):
var _ error = &UnhandledRetryableError{} // transactionRestartError is an interface implemented by errors that cause
nit: move this where it was to avoid the diff unless you had a reason to move it
pkg/roachpb/errors.go, line 54 at r2 (raw file):
} // ErrorPriority is used to rank errors such that the "best" one is chosen to be
say that highest score beats lower
This was accidentally lost in 1ff3556. Release note: None
Fixes cockroachdb#36024. Fixes cockroachdb#36094. 8b5bafb ensured that all transaction state was propagated by DistSender on errors. In doing so, it touched that fact that DistSender drops all but the first error that it sees. It ensured that even though this was the case, the error metadata from these dropped errors would still be propagated (see `pErr.UpdateTxn(resp.pErr.GetTxn())`). This has an unintended consequence where it was now possible for a non-aborting transaction retry error to be updated with an ABORTED transaction proto. This caused confusion in the TxnCoordSender, triggering panics like we see in cockroachdb#36024 and cockroachdb#36094. This change fixes this by being smarter about which errors get dropped when concurrent partial batches each hit an error in DistSender. It does this by prioritizing the most severe errors and merging transaction state into those. In a lot of ways, this is the DistSender equivalent of 574e805, which is why they now share code. Release note: None
5532def to
48bb3b7
Compare
nvb
commented
Jul 1, 2019
Contributor
Author
nvb
left a comment
There was a problem hiding this comment.
bors r=andreimatei
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @andreimatei)
pkg/roachpb/errors.go, line 42 at r2 (raw file):
Previously, andreimatei (Andrei Matei) wrote…
nit: move this where it was to avoid the diff unless you had a reason to move it
It seems to belong next to UnhandledRetryableError.
pkg/roachpb/errors.go, line 54 at r2 (raw file):
Previously, andreimatei (Andrei Matei) wrote…
say that highest score beats lower
Done.
craig bot
pushed a commit
that referenced
this pull request
Jul 1, 2019
38579: kv: prioritize severe errors when merging partial batches in DistSender r=andreimatei a=nvanbenschoten Fixes #36024. Fixes #36094. 8b5bafb ensured that all transaction state was propagated by `DistSender` on errors. In doing so, it touched that fact that `DistSender` drops all but the first error that it sees. It ensured that even though this was the case, the error metadata from these dropped errors would still be propagated (see `pErr.UpdateTxn(resp.pErr.GetTxn())`). This has an unintended consequence where it was now possible for a non-aborting transaction retry error to be updated with an ABORTED transaction proto. This caused confusion in the `TxnCoordSender`, triggering panics like the ones we see in #36024 and #36094. This change fixes this by being smarter about which errors get dropped when concurrent partial batches each hit an error in `DistSender`. It does this by prioritizing the most severe errors and merging transaction state into those. In a lot of ways, this is the `DistSender` equivalent of 574e805, which is why they now share code. Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Contributor
Build succeeded |
This was referenced Jul 8, 2019
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.
Fixes #36024.
Fixes #36094.
8b5bafb ensured that all transaction state was propagated by
DistSenderon errors. In doing so, it touched that fact thatDistSenderdrops all but the first error that it sees. It ensured that even though this was the case, the error metadata from these dropped errors would still be propagated (seepErr.UpdateTxn(resp.pErr.GetTxn())).This has an unintended consequence where it was now possible for a non-aborting transaction retry error to be updated with an ABORTED transaction proto. This caused confusion in the
TxnCoordSender, triggering panics like the ones we see in #36024 and #36094.This change fixes this by being smarter about which errors get dropped when concurrent partial batches each hit an error in
DistSender. It does this by prioritizing the most severe errors and merging transaction state into those. In a lot of ways, this is theDistSenderequivalent of 574e805, which is why they now share code.