Bug #14082 rpl_row_relayrotate: transaction NOT restarted at the right place using RBR.
Submitted: 17 Oct 2005 18:02 Modified: 6 Dec 2005 10:17
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0-wl1012 OS:Linux (Linux)
Assigned to: Guilhem Bichot CPU Architecture:Any

[17 Oct 2005 18:02] Jonathan Miller
Description:
Since bug # 12559 was marked closed, I decided to test rpl_row_relayrotate:
Notes from test case:
# We suppose the SQL thread stopped before COMMIT.  If so the transaction was rolled back
# and the table is now empty.  Now restart And see if the table contains '8000' which proves 
# that the transaction restarted at  the right place.  We must wait for the transaction to commit 
# before reading.

In debugging the test I found that for row based replication that the transaction commit did not happen until position 552270 which is 549270 position greater then the statement based test. After adjusting for this and even after adding a sleep 10, the most row returned out of the table on the slave 3069 leaving 4931 row of data lost.

+ select master_pos_wait('master-bin.001',552270)>=0;
+ master_pos_wait('master-bin.001',552270)>=0
+ 1
+ select max(a) from t1;
+ max(a)
+ 3069
+ show slave status;
+ Slave_IO_State        Master_Host     Master_User     Master_Port     Connect_Retry   Master_Log_File Read_Master_Log_Pos     Relay_Log_File  Relay_Log_Pos   Relay_Master_Log_File   Slave_IO_Running        Slave_SQL_Running       Replicate_Do_DB Replicate_Ignore_DB     Replicate_Do_Table      Replicate_Ignore_Table  Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table     Last_Errno      Last_Error      Skip_Counter    Exec_Master_Log_Pos     Relay_Log_Space Until_ConditionUntil_Log_File   Until_Log_Pos   Master_SSL_Allowed      Master_SSL_CA_File      Master_SSL_CA_Path      Master_SSL_Cert Master_SSL_Cipher       Master_SSL_Key  Seconds_Behind_Master
+ #     127.0.0.1       root    MASTER_MYPORT   1       master-bin.000001       552297  #      master-bin.000001        Yes     Yes                             #                       0      552297   #       None            0       No                                              #
+ drop table t1;

How to repeat:
Comment out rpl_row_relayrotate: in the disable.def file and run:
./mysql-test-run --skip-ndb --do-test=rpl_row_relayrotate --force --mysqld=--binlog-format=row
[6 Dec 2005 10:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/33059
[6 Dec 2005 10:17] 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
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

ChangeSet@1.1980, 2005-12-06 11:13:16+01:00, guilhem@mysql.com
  WL#1012 1) Fix for BUG#14082
Nothing to document