After trying to use the pt-online-schema-change tool to alter a table on our percona 5.7 cluster, the tool would consistently fail due to a “WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction” error.
After doing a bit of digging we found that whilst copying the data from the old data to the _new table it would get the above error (due to activity on the table) and would not retry the transaction as the error does not fall into the list of errors that the tool recognises - those errors being:
Lock wait timeout
Query is killed
Connection is killed
[*]Lost connection to MySQL
[/LIST] I was a bit confused as it the given error seemed like something the tool should be able to retry so after a bit more digging I found the following commit for the percona-xtradb-cluster which appeared to change the tests for use with 5.7? https://github.com/percona/percona-xtradb-cluster/commit/9e28f069217c91a5139fb7174d05e88a5d4a5850#diff-331f50bdc872eed70ac6715344b8ada8
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction
Is it the case that the “Deadlock found” error message has changed and the tool hasn’t caught up with it or should I provide some more debug information about our use case?