Using pt-online-schema-change with percona 5.7

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
]Deadlock found
[]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?

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?


Could you please create an issue in Jira?
Please include information about how to reproduce the issue.


Hi there! Thanks for the quick reply - as per your request I was able to replicate the issue in a dev environment and I’ve set up a jira ticket Please let me know if you need any more information or have any suggestions on what I can do to mitigate this.