Innodb rollback with wsrep reapplies deadlocked statements
General
Escalation
General
Escalation
Description
Found while investigating
At first it seemed like that similarly to , this issue is caused by incorrect conflict detection, but turns out the reason behind this is changed rollback logic:
PXC retries autocommit deadlocked transactions in sql_parse.cc:7577, but we only reach this code, if we are able to replicate it to another node. If wsrep isn't running, or the other node disconnects, we revert to upstream behavior, which is to report a deadlock and fail.
wsrep_retry_autocommit Description: Number of times autocommited queries will be retried due to cluster-wide conflicts before returning an error to the client. If set to 0, no retries will be attempted, while a value of 1 (the default) or more specifies the number of retries attempted. Can be useful to assist applications using autocommit to avoid deadlocks.
This variable also exists in 5.7, also defaults to 1, but behaves differently there.
Found while investigating
At first it seemed like that similarly to , this issue is caused by incorrect conflict detection, but turns out the reason behind this is changed rollback logic:
PXC retries autocommit deadlocked transactions in sql_parse.cc:7577, but we only reach this code, if we are able to replicate it to another node. If wsrep isn't running, or the other node disconnects, we revert to upstream behavior, which is to report a deadlock and fail.