forked from yugabyte/yugabyte-db
-
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.
[yugabyte#9468] YSQL: Ensure clients don't see serialization errors i…
…n READ COMMITTED isolation (Part-3) Summary: In this third part, we ensure that we don't throw kConflict errors to external ysql clients when using READ COMMITTED isolation level. We do this by - (1) Re-executing a statement when kConflict is seen: this is done by leveraging savepoints. An internal savepoint is created before execution of every statement, which is rolled back to on facing a kConflict. This helps get rid of any provisional writes that where written by the statement before the conflict and hence are no longer valid. The statement is retried indefinitely until statement timeout with configurable exponential backoff. This gives a feeling that pessimistic locking is also in place. Note that we also lazily rely only on the statement timeout to get rid of deadlocks, without proactively detecting them with a distributed deadlock detection algorithm. That will be come in as a separate improvement with pessimistic locking. (2) Using the highest priority for READ COMMITTED txns: this helps ensure that no other txns can abort a READ COMMITTED txn. Even other READ COMMITTED txns can't. Test Plan: Jenkins: urgent Enabled Postgres's existing eval-plan-qual isolation test with appropriate modifications to disable cases that require features yet to be implemented on YB. Added a bunch of new tests from the functional spec as well: src/test/isolation/specs/yb_pb_eval-plan-qual.spec src/test/isolation/specs/yb_read_committed_insert.spec src/test/isolation/specs/yb_read_committed_test_internal_savepoint.spec src/test/isolation/specs/yb_read_committed_update_and_explicit_locking.spec Reviewers: mihnea, alex, rsami, mtakahara Reviewed By: rsami, mtakahara Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D15383
- Loading branch information
Showing
40 changed files
with
1,003 additions
and
118 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
Oops, something went wrong.