forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#11760] [YSQL] Support NOWAIT for READ COMMITTED isolation l…
…evel Summary: The NOWAIT clause with a SELECT (that is attempting to take explicit lock(s)) ensures that if the statement sees another txn holding a conflicting lock mode, it will error out immediately with an error message like follows - "could not obtain lock on row in relation". The NOWAIT clause currently has no effect for any isolation level in YSQL. In READ COMMITTED isolation level - the statement would face a kConflict error and the statement retry mechanism of this isolation would retry indefinitely till the lock(s) are acquired (in yb_attempt_to_restart_on_error()). In REPEATABLE READ and SERIALIZABLE isolation level - the statement would either abort the conflicting txn(s) or would abort itself and throw a kConflict error. The former would occur if the statement's txn has higher priority than all conflicting txn(s). The diff fixes the semantics for READ COMMITTED isolation level as a first step since that is easier to do. All txns in READ COMMITTED isolation internally use the same priority and so the txn always faces a kConflict error. We just have to skip retrying the statement for such errors if the NOWAIT clause is specified. Test Plan: Jenkins: urgent ./yb_build.sh --java-test org.yb.pgsql.TestPgExplicitLocks#testNoWait Reviewers: mihnea Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D16007
- Loading branch information
Showing
2 changed files
with
98 additions
and
0 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