[MDEV-4726] Race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test Created: 2013-06-28 Updated: 2014-02-10 Resolved: 2014-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.3 |
| Fix Version/s: | 10.0.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jeremy Cole | Assignee: | Kristian Nielsen |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
There's a race in mysql-test/suite/rpl/t/rpl_gtid_stop_start.test as follows: The rpl_gtid_stop_start test used SELECT COUNT(*) as a wait_condition when waiting for rows to appear from the replication stream. Since the table it is waiting on is MyISAM, rows appearing there do not guarantee in any way that the GTID information will have been updated by the slave thread (and can't guarantee that). This causes a race in the test which is especially exacerbated by making the gtid_slave_pos table InnoDB, since then the COMMIT that is done as part of recording the GTID is bound to take some tens of milliseconds. |
| Comments |
| Comment by Jeremy Cole [ 2013-06-28 ] |
|
I attached a patch which changes the wait_condition to wait on the proper GTID to appear instead of waiting on a row count. I believe this to be the only actual way to wait without a race when using MyISAM for gtid_slave_pos; nonetheless this is safe and effective anyway. |
| Comment by Jeremy Cole [ 2013-06-28 ] |
|
We've had another failing test this morning which is also due to using SELECT COUNT |
| Comment by Elena Stepanova [ 2013-06-28 ] |
|
I'm not quite sure Kristian meant it to be a MyISAM table, maybe it just happened this way. I'll check with him before modifying tests. |
| Comment by Elena Stepanova [ 2013-06-28 ] |
|
Hi Kristian, See the above – did you mean the tables to be MyISAM? |
| Comment by Kristian Nielsen [ 2013-06-29 ] |
|
Thanks Jeremy for the nice analysis! I do not explicitly need the table to be MyISAM, on the other hand I did try The wait_condition.inc with COUNT The best solution is probably to implement include/save_master_gtid_pos.inc |
| Comment by Kristian Nielsen [ 2014-02-10 ] |
|
Should be fixed now. The synchronisation is now made with MASTER_GTID_WAIT() in the places where SELECT COUNT |