-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvserver: disallow timestamp regression with locking scans
After #46004, locking scans can now hit WriteTooOld errors if they encounter values at timestamps higher than their read timestamps. The `ActualTimestamp` recorded is the `encountered ts + 1`. When determining what the new timestamp for the txn should be, previously we blindly used the generated `encountered ts + 1`. This was buggy, and could lead to a timestamp regression in the case where a txn with (read_ts, write_ts) = (1, 4) finds a value with `ts = 2`. If we try to "bump" the txn to `ts = 3`, we're regressing the write ts. Now, when determining what the new timestamp should be, we ensure we use `max(encountered ts + 1, txn's current write ts)`. Fixes #43273. Release note: None Release justification: High-priority bug fix (resulted in panics for contended UPDATEs)
- Loading branch information
1 parent
1320e13
commit 3a9d409
Showing
6 changed files
with
39 additions
and
7 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
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