mirror of
https://github.com/MariaDB/server.git
synced 2025-02-09 23:24:11 +01:00
![Brandon Nesterenko](/assets/img/avatar_default.png)
Extends 89c907bd4f
to account for
binlog_two_phase_alter flags in a Gtid log event. I.e., if the
FL_COMMIT_ALTER_E1 or FL_ROLLBACK_ALTER_E2 flags are set in the
event flags, yet the length of the event is too short to hold
the value, then set the event as invalid
146 lines
4.1 KiB
Text
146 lines
4.1 KiB
Text
include/master-slave.inc
|
|
[connection master]
|
|
#
|
|
# Initialize test data
|
|
connection master;
|
|
create table t1 (a int) engine=innodb;
|
|
include/save_master_gtid.inc
|
|
set @@SESSION.debug_dbug= "+d,binlog_force_commit_id";
|
|
connection slave;
|
|
set SQL_LOG_BIN= 0;
|
|
call mtr.add_suppression('Found invalid event in binary log');
|
|
call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
|
|
set SQL_LOG_BIN= 1;
|
|
include/sync_with_master_gtid.inc
|
|
include/stop_slave.inc
|
|
include/start_slave.inc
|
|
#
|
|
# Test FL_PREPARED_XA
|
|
connection master;
|
|
set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid";
|
|
set @commit_id= 100;
|
|
XA START 'x1';
|
|
insert into t1 values (1);
|
|
XA END 'x1';
|
|
XA PREPARE 'x1';
|
|
set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid";
|
|
XA COMMIT 'x1';
|
|
include/save_master_gtid.inc
|
|
# Waiting for slave to find invalid event..
|
|
connection slave;
|
|
include/wait_for_slave_sql_error.inc [errno=1594]
|
|
STOP SLAVE IO_THREAD;
|
|
# Reset master binlogs (as there is an invalid event) and slave state
|
|
connection master;
|
|
RESET MASTER;
|
|
connection slave;
|
|
RESET MASTER;
|
|
RESET SLAVE;
|
|
set @@global.gtid_slave_pos="";
|
|
include/start_slave.inc
|
|
#
|
|
# Test FL_COMPLETED_XA
|
|
connection master;
|
|
set @commit_id= 101;
|
|
XA START 'x1';
|
|
insert into t1 values (2);
|
|
XA END 'x1';
|
|
XA PREPARE 'x1';
|
|
set @@SESSION.debug_dbug= "+d,negate_xid_from_gtid";
|
|
XA COMMIT 'x1';
|
|
set @@SESSION.debug_dbug= "-d,negate_xid_from_gtid";
|
|
include/save_master_gtid.inc
|
|
# Waiting for slave to find invalid event..
|
|
connection slave;
|
|
include/wait_for_slave_sql_error.inc [errno=1594]
|
|
STOP SLAVE IO_THREAD;
|
|
# Cleanup hanging XA PREPARE on slave
|
|
set statement SQL_LOG_BIN=0 for XA COMMIT 'x1';
|
|
# Reset master binlogs (as there is an invalid event) and slave state
|
|
connection master;
|
|
RESET MASTER;
|
|
connection slave;
|
|
RESET MASTER;
|
|
RESET SLAVE;
|
|
set @@global.gtid_slave_pos="";
|
|
include/start_slave.inc
|
|
#
|
|
# Test Missing xid.data (but has format id and length description parts)
|
|
connection master;
|
|
set @commit_id= 101;
|
|
XA START 'x1';
|
|
insert into t1 values (1);
|
|
XA END 'x1';
|
|
XA PREPARE 'x1';
|
|
set @@SESSION.debug_dbug= "+d,negate_xid_data_from_gtid";
|
|
XA COMMIT 'x1';
|
|
set @@SESSION.debug_dbug= "-d,negate_xid_data_from_gtid";
|
|
include/save_master_gtid.inc
|
|
# Waiting for slave to find invalid event..
|
|
connection slave;
|
|
include/wait_for_slave_sql_error.inc [errno=1594]
|
|
STOP SLAVE IO_THREAD;
|
|
# Cleanup hanging XA PREPARE on slave
|
|
set statement SQL_LOG_BIN=0 for XA COMMIT 'x1';
|
|
# Reset master binlogs (as there is an invalid event) and slave state
|
|
connection master;
|
|
RESET MASTER;
|
|
connection slave;
|
|
RESET MASTER;
|
|
RESET SLAVE;
|
|
set @@global.gtid_slave_pos="";
|
|
include/start_slave.inc
|
|
#
|
|
# Test FL_EXTRA_MULTI_ENGINE
|
|
connection master;
|
|
set @old_dbug= @@SESSION.debug_dbug;
|
|
set @@SESSION.debug_dbug= "+d,inject_fl_extra_multi_engine_into_gtid";
|
|
set @commit_id= 102;
|
|
insert into t1 values (3);
|
|
include/save_master_gtid.inc
|
|
set @@SESSION.debug_dbug=@old_dbug;
|
|
connection slave;
|
|
# Waiting for slave to find invalid event..
|
|
include/wait_for_slave_sql_error.inc [errno=1594]
|
|
STOP SLAVE IO_THREAD;
|
|
# Reset master binlogs (as there is an invalid event) and slave state
|
|
connection master;
|
|
RESET MASTER;
|
|
connection slave;
|
|
RESET SLAVE;
|
|
RESET MASTER;
|
|
set @@global.gtid_slave_pos="";
|
|
include/start_slave.inc
|
|
#
|
|
# Test FL_COMMIT_ALTER
|
|
connection master;
|
|
set @old_dbug= @@SESSION.debug_dbug;
|
|
set @@SESSION.debug_dbug= "+d,negate_alter_fl_from_gtid";
|
|
set @old_alter_tp= @@SESSION.binlog_alter_two_phase;
|
|
set @@SESSION.binlog_alter_two_phase= 1;
|
|
alter table t1 add column (nc int);
|
|
include/save_master_gtid.inc
|
|
set @@SESSION.debug_dbug=@old_dbug;
|
|
set @@SESSION.binlog_alter_two_phase=@old_alter_tp;
|
|
connection slave;
|
|
# Waiting for slave to find invalid event..
|
|
include/wait_for_slave_sql_error.inc [errno=1594]
|
|
STOP SLAVE IO_THREAD;
|
|
# Reset master binlogs (as there is an invalid event) and slave state
|
|
connection master;
|
|
RESET MASTER;
|
|
connection slave;
|
|
SET STATEMENT sql_log_bin=0 FOR alter table t1 add column (nc int);
|
|
RESET SLAVE;
|
|
RESET MASTER;
|
|
set @@global.gtid_slave_pos="";
|
|
include/start_slave.inc
|
|
#
|
|
# Cleanup
|
|
connection master;
|
|
drop table t1;
|
|
include/save_master_gtid.inc
|
|
connection slave;
|
|
include/sync_with_master_gtid.inc
|
|
include/rpl_end.inc
|
|
# End of rpl_gtid_header_valid.test
|