Bug #32756 Starting and stopping the slave in a loop can lose rows
Submitted: 27 Nov 2007 8:44 Modified: 17 Sep 2008 8:28
Reporter: Mats Kindahl Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Replication Severity:S2 (Serious)
Version: OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[27 Nov 2007 8:44] Mats Kindahl
Starting and stopping the slave in a loop on a heavy loaded system can cause the slave to lose rows. This failure occurs occasionally in pushbuild.

How to repeat:
let $i= 100;
while ($i)
  start slave;
  connection master;
  insert into t1 values (NULL);
  select * from t1; # Some variance
  connection slave;
  select * from t1; # Some variance
  stop slave;
  dec $i;

Suggested fix:
Make sure that starting and stopping the slave does cause the master log info and relay log info to get out of sync.
[15 Aug 2008 6:08] Sveta Smirnova
Thank you for the report.

In my case either slave crashes with "Lost connection to MySQL server during query" doing STOP SLAVE or slave IO thread fails. After restoring slave data is same on master and slave. Do you experience same behavior or you loose data in the middle?
[15 Sep 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[16 Sep 2008 9:02] Mats Kindahl
No, data is lost in my case (just a single row, but that is sufficient).
[17 Sep 2008 8:28] Sveta Smirnova
Thank you for the feedback.

There is closed bug #32217 about same failure in pushbuild. So I close this one as duplicate.

Regarding to testing if this is replication problem I think we need master.info, relay-log.info and relay log files for time when this problem occurs. If you see same failure next time please provide requested files and reopen the report.