Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3991 [YSQL] Handle transaction conflict status in case of parallel r…
…ead operations Summary: For now `SELECT` command can generate multiple `PgDocReadOp` and execute them in single batch by calling `PgSession::RunAsync` method which takes list of operations. These read operations can conflicts with running transaction. Status for these operations will be `Status::TryAgain` with appropriate error code(s). It could be `YBPgErrorCode`, `TransactionErrorCode` or other. `PgSession` return single status as a result of `PgSession::RunAsync` method. Base of this status upper level will try to restart operations in case no data was sent to users. In case all failed operations has status with same code and same additional error codes single status is returned with same this code and additional error codes. Message of new status enumerates all error statuses with prefix `Multiple homogeneous errors`. Example: single `TryAgain` status constructed from 2 homogeneous statuses (status messages may be different): ``` Operation failed. Try again. (yb/yql/pggate/pg_session.cc:169): Multiple homogeneous errors: [ Operation failed. Try again. (yb/tablet/running_transaction.cc:385): Transaction aborted: b8f9ae55-3c84-4ed6-8354-fafbb8cb803f (pgsql error 25P02), Operation failed. Try again. (yb/tablet/transaction_participant.cc:263): Unknown transaction, could be recently aborted: b8f9ae55-3c84-4ed6-8354-fafbb8cb803f (pgsql error 25P02)] (pgsql error 25P02) ``` Test Plan: Run existed unit test `./yb_build.sh --java-test org.yb.pgsql.TestPgReadRestarts#selectCountPrepared` Reviewers: raju, mihnea, alex Reviewed By: alex Subscribers: yql Differential Revision: https://phabricator.dev.yugabyte.com/D8144
- Loading branch information