Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Patch Pulled from: https://www.postgresql-archive.org/WIP-Patch-Pgbench-Serialization-and-deadlock-errors-td5966663i40.html Client's run is aborted only in case of a serious error, for example, the connection with the backend was lost. Otherwise if the execution of SQL or meta command fails, the client's run continues normally until the end of the current script execution (it is assumed that one transaction script contains only one transaction). Transactions with serialization or deadlock failures are rolled back and repeated until they complete successfully or reach the maximum number of tries (specified by the --max-tries option) / the maximum time of tries (specified by the --latency-limit option). These options can be combined together; but if none of them are used, failed transactions are not retried at all. If the last transaction run fails, this transaction will be reported as failed, and the client variables will be set as they were before the first run of this transaction. If there're retries and/or errors their statistics are printed in the progress, in the transaction / aggregation logs and in the end with other results (all and for each script). A transaction error is reported here only if the last try of this transaction fails. Also retries and/or errors are printed per-command with average latencies if you use the appropriate benchmarking option (--report-per-command, -r) and the total number of retries and/or errors is not zero. If a failed transaction block does not terminate in the current script, the commands of the following scripts are processed as usual so you can get a lot of errors of type "in failed SQL transaction" (when the current SQL transaction is aborted and commands ignored until end of transaction block). In such cases you can use separate statistics of these errors in all reports. If you want to distinguish between failures or errors by type (including which limit for retries was violated and how far it was exceeded for the serialization/deadlock errors), use the pgbench debugging output created with the option --debug and with the debugging level "fails" or "all". The first variant is recommended for this purpose because with in the second case the debugging output can be very large. Test Plan: yb-ctl create ./build/latest/postgres/bin/pgbench -i -s 3 postgres ./build/latest/postgres/bin/pgbench -P 5 -T 60 -n -N -r -c 16 -j 4 --max-tries 3 postgres Reviewers: mihnea Reviewed By: mihnea Subscribers: mihnea, karthik, kannan, neha, rahuldesirazu, bogdan, yql Differential Revision: https://phabricator.dev.yugabyte.com/D7065
- Loading branch information