Bug #89143 | Commit order deadlock + retry logic is not considering trx error cases | ||
---|---|---|---|
Submitted: | 8 Jan 2018 22:10 | Modified: | 26 Apr 2018 10:39 |
Reporter: | Jean-François Gagné | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.7.20 | OS: | Any |
Assigned to: | Venkatesh Duggirala | CPU Architecture: | Any |
[8 Jan 2018 22:10]
Jean-François Gagné
[11 Jan 2018 8:10]
MySQL Verification Team
Hello Jean, Thank you for the report and feedback. Thanks, Umesh
[11 Jan 2018 8:11]
MySQL Verification Team
Taken from Bug#89141
Attachment: 89141_5.7.20.results (application/octet-stream, text), 46.86 KiB.
[23 Feb 2018 15:08]
Venkatesh Duggirala
Post by Developer: ================== Hello Jean, Thank you for using MySQL and thank for raising the issue. Please note that I am able to reproduce the issue even on mysql-8.0.3 (standard replication), the issue not just on Group Replication. There is no difference in the slave_transaction_retries logic between Standard replication and Group Replication. (problem is in detecting commit order dead lock + retry logic which exists in 5.7 as well) Problem: If two workers are executing two transactions, they can end up deadlock because of the preserve commit order logic. Once the server detects that there is a deadlock between two workers, it rollbacks the later transaction (later in the order), so that the first trx (first in the order) will get the lock and continue it's operation and then server will retry the second transaction. But here after server detects the deadlock, it can happen that second transaction is failed due to some other error (temporary error). This case is not considered when we are trying to "retry the transaction". I will be uploading a test script for your reference, if you run against 5.7, you can see in the error log "Duplicate entry" error twice. The test script is little modification to the first test case in mysql-test/suite/rpl/t/rpl_mts_slave_preserve_commit_order_deadlock.test. I will be changing the category, version and the title of the bug appropriately, please let me know if you have any questions on the same. Regards, Venkatesh.
[23 Feb 2018 15:20]
Venkatesh Duggirala
Test script to reproduce it on 5.7 version
Attachment: bug89413_mysql-5.7.test (application/octet-stream, text), 2.12 KiB.
[26 Feb 2018 12:16]
João Gramacho
Posted by developer: I guess this is a duplicate of Bug#27090385.
[26 Apr 2018 10:39]
Margaret Fisher
Posted by developer: Changelog entry added for MySQL 8.0.12 and MySQL 5.7.23: Automatic retrying of transactions on a replication slave, as specified by the slave_transaction_retries system variable, was taking place even if the transaction had a non-temporary error that would repeat on retrying or that indicated wider issues. Now, transactions are only automatically retried if there is either no error, or an error that is only temporary. Also noted in slave_transaction_retries documentation.
[2 Jul 2018 14:06]
Margaret Fisher
Posted by developer: Updated releases on changelog entry to 5.7.24 and 8.0.13.