← Back
Editing: rpl_partial_gtid_trx_followed_by_trx_at_startup.test
# ==== Purpose ==== # # This test will make slave to replicate a partial GTID transaction # followed by a complete GTID transaction and will restart the slave # in order to verify that the startup procedure does not add the GTID # of the partial transaction to the Retrieved_Gtid_Set. # # The server and the I/O thread should not add the partial GTID into # the Retrieved_Gtid_Set nor execute the partial GTID transaction. # # The test case will transform a single XID event into an ignorable # unknown event that will not be written to the slave relay log. # Because of this, the slave will assume it doesn't # fully retrieved the transaction and will not count on its GTID. # # As before WL#7083 a GTID enabled server cannot apply ANONYMOUS # transactions, we will let the SQL thread stopped at the slave. # # TODO: To enable the SQL thread after WL#7083. # # ==== Related Bugs and Worklogs ==== # # BUG#20400132 TRANSACTION BOUNDARY PARSER SHOULD NOT DEPEND ON GTID_MODE # --source include/not_group_replication_plugin.inc # This test should run only on debug build --source include/have_debug.inc # This test uses debug sync to stop the IO thread in the middle of a transaction --source include/have_debug_sync.inc --source include/have_innodb.inc --source include/have_binlog_format_row.inc --let $rpl_gtid_utils= 1 --source include/have_gtid.inc --source include/master-slave.inc # Disable slave's auto_positioning --source include/rpl_connection_slave.inc --source include/stop_slave.inc CHANGE MASTER TO MASTER_AUTO_POSITION=0; --let $use_gtids= 0 call mtr.add_suppression("An unexpected event sequence was detected by the IO thread"); call mtr.add_suppression("GTID_LOG_EVENT .* is not expected in an event stream"); --source include/start_slave_io.inc # Reset the GTID counter for assertion --source include/gtid_step_reset_on_retrieved.inc # Set slave to transform a Xid event in an ignorable unknown event --let $debug_point= simulate_unknown_ignorable_log_event_with_xid --source include/add_debug_point.inc # Create a table at the master using GTID --source include/rpl_connection_master.inc --echo # This should be MASTER_UUID:1 CREATE TABLE t1 (c1 INT) ENGINE= InnoDB; --source include/sync_slave_io_with_master.inc # Inserting some data --source include/rpl_connection_master.inc --echo # This should be MASTER_UUID:2, --echo # but it will not be fully retrieved nor applied on slave INSERT INTO t1 VALUES (1); --echo # This should be MASTER_UUID:3, # This should not have a XID to avoid the transformation into an # unknown ignorable event, but it will be at the same binlog/relaylog # file as the incomplete transaction. CREATE TABLE t2 (c1 INT) ENGINE=InnoDB; # Sync slave IO before stopping the slave --source include/sync_slave_io_with_master.inc --source include/stop_slave_io.inc --source include/remove_debug_point.inc # Insert more data on master --source include/rpl_connection_master.inc --echo # This should be MASTER_UUID:4 INSERT INTO t1 VALUES (3); --source include/rpl_connection_slave.inc # Restart the slave --let $rpl_server_number= 2 --source include/rpl_restart_server.inc # Start slave IO thread and sync slave with master --source include/start_slave_io.inc --source include/rpl_connection_master.inc --source include/sync_slave_io_with_master.inc # Assert that only three GTIDs were added to the Retrieved_Gtid_Set --let $gtid_step_count= 3 --let $gtid_step_only_count= 1 --source include/gtid_step_assert_on_retrieved.inc # Cleanup # Restore the slave --source include/stop_slave_io.inc RESET SLAVE; RESET MASTER; CHANGE MASTER TO MASTER_AUTO_POSITION= 1; --let $use_gtids= 1 # Cleanup the master --source include/rpl_connection_master.inc DROP TABLE t1,t2; RESET MASTER; --source include/rpl_connection_slave.inc --source include/start_slave.inc --source include/rpl_end.inc
Save File
Cancel