forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: favor WriteTooOld errors over ConditionFailed errors
This commit adjusts mvccPutInternal to return WriteTooOld errors instead of ConditionFailedErrors when a write-write version conflict is encountered during conditional write evaluation and the write's condition is also not met. Previously, the logic favored ConditionFailed errors, which was necessary for correctness because of write-too-old deferral. This resulted in subtle logic to determine which timestamp to evaluate the condition at. It was also overly pessimistic in cases where the condition failed at the version below the write-write conflict but succeeded at the version after. This is demonstrated by some of the changes to the test cases in TestTxnCoordSenderRetries and TestReplicaServersideRefreshes. Now that write-too-old deferral is gone, we can simplify the logic. Release note: None
- Loading branch information
1 parent
e7cf003
commit 59f90a5
Showing
5 changed files
with
66 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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