[YSQL] Non-transactional side-effects can occur more than once when a conflict/ read restart error in functions/ procedures is handled by read committed isolation level #12958
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/bug
This issue is a bug
pg-compatibility
Label for issues that result in differences b/w YSQL and Pg semantics
priority/medium
Medium priority issue
Jira Link: DB-2692
Description
Right now, statements are internally retried in READ COMMITTED isolation level with exponential backoff if a kConflict or kReadRestart error is seen at the query layer. They are retried on a new latest snapshot for kConflict and with restart read time for kReadRestart errors.
However the following known issue can occur -
call f() would fail because deallocation on dummy_query would be attempted more than once. The error wouldn't occur if only the statement that faced the conflict in the procedure was retried. This is not an issue in Postgres because it handles conflicts with eval plan qual handling (see #11573).
This issue would be solved for kConflicts once #11573 is fixed. It might be solved for kReadRestart too in case the solution for #11572 gets rid of statement retries for kReadRestart errors using some new scheme to get rid of kReadRestart errors.
The text was updated successfully, but these errors were encountered: