-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
catalog: ensure that lease generation stays fixed for long txns
Previously, for long running txn's the lease generation would always get the latest value, which could then be set in the memo. This was incorrect because a transaction at an older timestamp may intentionally be observing the past (old descriptors), so the results of the staleness check should not say the memo is valid for any later lease generations. This would mean that tests with schema changes and long running txns like TestTxnCanStillResolveOldName would fail, since the memo would be incorrectly marked as not stale, because of a long running query. To address this, this patch caches the lease generation inside the descriptor collection at the start of any txn. A simple example of this scenario: conn 1: BEGIN; SELECT * FROM t; conn 2: ALTER TABLE t RENAME TO t2; conn 1: SELECT * FROM t; COMMIT; SELECT * FROM t; -- the memo staleness check should fail. Release note: None
- Loading branch information
Showing
4 changed files
with
37 additions
and
5 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