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.
sql: use txn timestamp when comparing time in table leases
Prior to this change we used the clocks current time when deciding if a lease expired. We would also store the current time as the modification time for the table descriptor. It was much harder to see if we could hit weird race conditions and it was almost impossible to reasona around correctness. This change moves all the table lease logic to use the txn timestamp when writing timestamps and when comparing timestamps for expiration. It is a lot easier to reason about the code after this change. This change also returns a retryable error when a transaction encounters two different versions of the same table descriptor. fixes cockroachdb#2948
- Loading branch information
1 parent
9433411
commit 3080a94
Showing
14 changed files
with
437 additions
and
304 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.