Bug #57204 5.1 binlogs/replication break after deadlock and mixing myisam/innodb in a trx
Submitted: 3 Oct 2010 11:30 Modified: 8 Oct 2010 15:06
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S2 (Serious)
Version:5.1.52 OS:Any
Assigned to: Alfranio Tavares Correia Junior CPU Architecture:Any

[3 Oct 2010 11:30] Shane Bester
Description:
you can't reliably mix innodb and myisam tables in a transaction on 5.1 with RBR.
when the master hits a deadlock, the binlogs become incorrect and slave breakage happens like this, for example

101003 13:24:35 [ERROR] Slave SQL: Could not execute Update_rows event on table test.ttt2; Can't find record in 'ttt2', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log levovo-bin.000001, end_log_pos 23486, Error_code: 1032

5.5.7 slave didn't break with this testcase.

How to repeat:
master:
./bin/mysqld --no-defaults --basedir=. --datadir=./data --skip-gr --skip-na --myisam-recover=force --server-id=1 --log-bin --binlog-format=row --tmpdir=. --socket=sock --port=3306 --innodb-lock-wait-timeout=1 --innodb-flush-log-at-trx-commit=0

slave:
./bin/mysqld --no-defaults --basedir=. --datadir=./data --skip-gr --skip-na --myisam-recover=force
 --server-id=2 --tmpdir=. --socket=sock --port=3307 --innodb-lock-wait-timeout=1  --innodb-flush-log-at-trx-commit=0

run the attached .c testcase against the master, watch slave fail quickly./
[3 Oct 2010 11:37] MySQL Verification Team
testcase. point it to a 5.1.X RBR binlogging master. examine slave status.

Attachment: bug57204.c (text/plain), 17.25 KiB.

[6 Oct 2010 19:11] Konstantin Osipov
As part of triage, I believe this is to risky to fix in 5.1.
Is fixed in 5.5.
[8 Oct 2010 15:07] Omer Barnir
Issue addresses in 5.5 - won't fix in 5.1