[MDEV-7668] Intermediate master groups CREATE TEMPORARY with INSERT, causing parallel replication failure Created: 2015-03-05 Updated: 2015-04-20 Resolved: 2015-03-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0.16, 10.0.17 |
| Fix Version/s: | 10.0.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | parallelslave, replication | ||
| Environment: |
rhel5 x86_64 |
||
| Description |
|
While running a pt-table-sync the following replication error occurred on two 10.0.17 slaves and one 10.0.16 slave. One 10.0.16 slave was lucky enough not to have its replication stopped. This slave is a 10.0.17 version running with slave-parallel-threads = 20 with not in gtid mode. It appears the pt-table-sync is creating, inserting into and dropping the temp table drupal_yourlanguage_prod.__maatkit_char_chunking_map frequently. In the replication stream it appears that the insert was processed before the create temporary table or after the drop table.
|
| Comments |
| Comment by Daniel Black [ 2015-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Master binlog settings:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2015-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/2.2/view/head:/bin/pt-table-sync#L4013 version 2.2.13 used. pt-table-sync is also explicitly statement based. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2015-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Some additional information from the reporter: This error occurs on slaves S1-4 in a setup: M1 <-> M2 -> S1-4 M1 and M2 are 10.0.15. S1-4 are 10.0.16/10.0.17 The queries are originally run in M1 (server_id=8). They are replicated to M2 We see in the binlog snippet, which is from M2, that three transactions were GTID 0-8-822549387 cid=2030318995 CREATE TEMPORARY TABLE `drupal_yourlanguage_prod`.`__maatkit_char_chunking_map` GTID 0-9-822549392 cid=2030318995 GTID 0-8-822549388 cid=2030318995 INSERT INTO `drupal_yourlanguage_prod`.`__maatkit_char_chunking_map` This is the reason it fails on the slaves; the CREATE and the INSERT are This scenario seems quite special (in case one wants to try and reproduce): A | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2015-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Ok, I managed to reproduce, here is an MTR test case (needs the .cnf below):
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2015-03-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The problems seems to be lack of locking around temporary tables. So there is nothing that prevents the INSERT INTO temptable to commit in parallel with CREATE TEMPORARY TABLE temptable. This then causes the statements to replicate in parallel on the lower-level slave, causing failure. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2015-03-09 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pushed to 10.0.18: http://lists.askmonty.org/pipermail/commits/2015-March/007545.html The bug here happens when using statement-based replication with temporary A third-level slave, also with parallel replication enabled, might then in |