-
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.
kvcoord: keep refresh spans after savepoint rollback
Previously, when a read occurred between SAVEPOINT and ROLLBACK TO SAVEPOINT, upon rollback the read was removed from the transaction's refresh spans. If the transaction's read and write timestamps diverged, this read would not be refreshed, which could lead to a serializability violation. Moreover, this behavior diverged from the Postgres behavior, which considers reads in a subtransaction to belong to the parent transaction (https://github.com/postgres/postgres/blob/master/src/backend/storage/lmgr/README-SSI#L461-L467). This patch adresses the issue by ensuring that all refresh spans accumulated since a savepoint was created are kept after the savepoint is rolled back. We don't expect this new behavior to impact customers because they should already be able to handle serialization errors; in case any unforeseen customer issues arise, this patch also includes a private cluster setting to revert to the old behavior. Fixes: #111228 Release note (bug fix): Reads rolled back by savepoints are now refreshable, matching the Postgres behavior and avoiding potential serializability violations.
- Loading branch information
1 parent
6d1bad3
commit a0e714c
Showing
3 changed files
with
154 additions
and
48 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