mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
When the I/O thread was stopped while copying a long transaction, and restarted,
Rotate_log_event::exec_event() believed that the relay log was corrupted. Fixed it by moving the test for corruption to Start_log_event::exec_event(). Changed Rotate_log_event::exec_event() to not increment positions when the event is seen in the middle of a transaction. I did a separate commit in 4.1 (so this should not be merged to 4.0) because code is a bit different in 4.1. A test to see if the slave detects when the master died while writing a transaction to the binlog (uses a forged truncated binlog I made). sql/log_event.cc: When the I/O thread was stopped while copying a long transaction, and restarted, Rotate_log_event::exec_event() believed that the relay log was corrupted. Fixed it by moving the test for corruption to Start_log_event::exec_event(). Changed Rotate_log_event::exec_event() to not increment positions when the event is seen in the middle of a transaction.
This commit is contained in:
22
mysql-test/t/rpl_trunc_binlog.test
Normal file
22
mysql-test/t/rpl_trunc_binlog.test
Normal file
@ -0,0 +1,22 @@
|
||||
# We are testing if a binlog which contains BEGIN but not COMMIT (the master did
|
||||
# while writing the transaction to the binlog) triggers an error on slave.
|
||||
# So we use such a truncated binlog and simulate that the master restarted after
|
||||
# this.
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
connection slave;
|
||||
stop slave;
|
||||
connection master;
|
||||
flush logs;
|
||||
system mv -f var/log/master-bin.001 var/log/master-bin.002;
|
||||
system cp std_data/trunc_binlog.001 var/log/master-bin.001;
|
||||
connection slave;
|
||||
reset slave;
|
||||
start slave;
|
||||
# can't sync_with_master so we must sleep
|
||||
sleep 3;
|
||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
||||
show slave status;
|
||||
connection master;
|
||||
reset master;
|
Reference in New Issue
Block a user