[MDEV-6903] [PATCH] gtid_slave_pos is incorrect after master crash Created: 2014-10-21 Updated: 2014-11-25 Resolved: 2014-11-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0.14 |
| Fix Version/s: | 10.0.16 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Pavel Ivanov | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
In the situation of master crash discussed in https://mariadb.atlassian.net/browse/MDEV-6462 slave can recover now in terms that the partial transaction is rolled back and SQL thread execution position points to the same place in master's binlog as IO thread current position. But gtid_slave_pos is increased and contains GTID of the transaction that was never committed. Besides the confusion of what gtid_current_pos points to in such situation it can also lead to slaves skipping one transaction from master's binlog when writes continue to restarted master. I'm attaching the one-line patch that fixes the problem along with extension to tests added in Note that the problem feels like https://mariadb.atlassian.net/browse/MDEV-4906 wasn't fixed fully. And the patch makes me wonder: should gtid_sub_id be actually reset to 0 inside cleanup_context()? Maybe without that there could be some other situations when gtid_slave_pos is wrong and has GTID of a rolled back transaction? |
| Comments |
| Comment by Kristian Nielsen [ 2014-10-21 ] |
|
Thanks for tracking this down! I share your concern wrt. possible other similar situations. I will check this in the code before applying the fix. |
| Comment by Pavel Ivanov [ 2014-10-23 ] |
|
The patch I've attached before had test that was flaky and didn't reproduce the transaction loss on the slave consistently. Attaching the new one with the corrected test. |
| Comment by Kristian Nielsen [ 2014-11-25 ] |
|
Pushed to 10.0.16, thanks Pavel for tracking it down and for the test case! |