-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YSQL] Transparently restart first statement in txn when possible #9467
Labels
area/ysql
Yugabyte SQL (YSQL)
Comments
pkj415
added a commit
to pkj415/yugabyte-db
that referenced
this issue
Sep 22, 2021
…ransparent retries are performed Summary: Retries are performed in the following extra cases (ofcourse when no response data has been sent to external client): 1. kReadRestart error on DMLs. In this case, the same txn is re-used. It follows that same path as a retry on kReadRestart for SELECT. 2. kConflict error on SELECTs. In this case, a different txn is created but with same priority. It follows the same path as a retry on kConflict for DMLs. 3. KAborted error on DMLs/SELECTs. Note that a kAborted can only be received for a txn T1 if another txn's read/write request finds a conflict and aborts T1. (TODO: Confirm this claim) If this claim is true, we can retry these same as kConflict errors. Test Plan: Jenkins: skip TBD Reviewers: alex, dmitry, sergei, mihnea Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D12597
pkj415
added a commit
to pkj415/yugabyte-db
that referenced
this issue
Sep 28, 2021
…ransparent retries are performed Summary: Retries are performed in the following extra cases (ofcourse when no response data has been sent to external client): 1. kReadRestart error on DMLs. In this case, the same txn is re-used. It follows that same path as a retry on kReadRestart for SELECT. 2. kConflict error on SELECTs. In this case, a different txn is created but with same priority. It follows the same path as a retry on kConflict for DMLs. 3. KAborted error on DMLs/SELECTs. Note that a kAborted can only be received for a txn T1 if another txn's read/write request finds a conflict and aborts T1. (TODO: Confirm this claim) If this claim is true, we can retry these same as kConflict errors. Test Plan: Jenkins: skip TBD Reviewers: alex, dmitry, sergei, mihnea Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D12597
pkj415
added a commit
that referenced
this issue
Oct 1, 2021
…performed Summary: Retries are performed by the postgres layer in the following extra cases (of-course when no response data has been sent to external client): i) **kReadRestart error on DMLs.** - In this case, a new txn is created. It follows that same path as a retry on kReadRestart for SELECT ii) **kConflict error on SELECTs.** - In this case, a new txn is created but with same priority. It follows the same path as a retry on kConflict for DMLs. There are some fixes that were required - 1. Add PG_TRY/PG_CATCH that was missing in portalcmds.c 2. Flushing buffered ops are end of PG_TRY() in PortalRun(). Reason added as comment inline with code. Test Plan: ./yb_build.sh --java-test org.yb.pgsql.TestPgReadRestarts#update ./yb_build.sh --java-test org.yb.pgsql.TestPgReadRestarts#delete ./yb_build.sh --java-test org.yb.pgsql.TestPgWriteRestart#testSelectConflictRestart Reviewers: sergei, smishra, mihnea, alex, dmitry Reviewed By: alex, dmitry Subscribers: zyu, yql Differential Revision: https://phabricator.dev.yugabyte.com/D12597
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently transparent retries are performed for first statement of an implicit/ explicit txn in two cases -
We should also handle -
The text was updated successfully, but these errors were encountered: