Bug #1475 If I/O slave thread stopped while copying big transaction, wrong error message
Submitted: 4 Oct 2003 6:36 Modified: 4 Oct 2003 6:43
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.0.15only OS:Any (all)
Assigned to: Guilhem Bichot

[4 Oct 2003 6:36] Guilhem Bichot
This bug was introduced in 4.0.15 and is fixed in 4.0.16.
If, while the I/O slave thread is copying a long transaction (many queries) to the relay log, someone does STOP SLAVE and START SLAVE, then there are chances that the SQL slave thread later stops and says that the relay log contains an unfinished transaction. The bug is in the slave.

How to repeat:
Do many queries in a transaction on the master.
On the slave, do START SLAVE and quickly do STOP SLAVE (before the I/O slave thread has read all the master's binlog). Do START SLAVE, the SQL slave thread will stop with an error message ("unfinished transaction").
Symptom was a random failure of the rpl_relayrotate test (from the MySQL testsuite) in the 4.1 BitKeeper tree.

Suggested fix:
Some code was introduced in 4.0.15 to detect unfinished transactions (when the master died brutally while writing a transaction to the binary log) in the relay log. Unfortunately there is a legal case which it detects as an unfinished transaction. This is now fixed in 4.0.16.
[4 Oct 2003 6:36] Guilhem Bichot
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at

ChangeSet@1.1593.1.1, 2003-10-03 22:13:01+02:00, guilhem@mysql.com