← Back
Editing: gr_view_change_delayed_write_order.test
################################################################################ # This test validates that even when there is a timeout while logging a VCLE # in a group change, the event will be logged later with no repercussions to # the recovery process. # # References: Bug#28971594 # # Steps: # 0. This test needs 3 servers, they are stopped and in Multi primary mode # 1. Create a user to ensure server 3 recovery comes from server 1 # 2. Start group replication in server 1 and 2 # 3. Block a local transaction on server 1 # 4. Start server 3, it should be stuck in recovery # Even after 15 seconds it should still be stuck # 5. Execute something on server 2, it should appear on server 3 # 6. Unblock the local transaction on server 1 # 7. Server 3 should now be online # 8. Check the logged event order in all servers # 9. Clean up # --source include/have_debug_sync.inc --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --let $rpl_server_count= 3 --source ../inc/group_replication.inc --echo # --echo # 1. Create a user to ensure server 3 recovery comes from server 1 --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $recovery_user= recovery_user --let $recovery_password= recovery_password SET SESSION sql_log_bin= 0; --eval CREATE USER "$recovery_user" IDENTIFIED BY "$recovery_password" --eval GRANT REPLICATION SLAVE ON *.* TO "$recovery_user" FLUSH PRIVILEGES; SET SESSION sql_log_bin= 1; --echo # --echo # 2. Start group replication in server 1 and 2 --let $rpl_connection_name= server1 --source include/rpl_connection.inc --source ../inc/start_and_bootstrap_group_replication.inc CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; --let $rpl_connection_name= server2 --source include/rpl_connection.inc --source include/start_group_replication.inc --echo # --echo # 3. Block a local transaction on server 1 --let $rpl_connection_name= server1 --source include/rpl_connection.inc SET @@GLOBAL.DEBUG='+d,group_replication_after_before_commit_hook'; --send INSERT INTO t1 VALUES (1) --echo # --echo # 4. Start server 3, it should be stuck in recovery --echo # Even after 15 seconds it should still be stuck --let $rpl_connection_name= server3 --source include/rpl_connection.inc --disable_warnings --eval CHANGE MASTER TO MASTER_USER= '$recovery_user', MASTER_PASSWORD= '$recovery_password' FOR CHANNEL 'group_replication_recovery' --enable_warnings --let $group_replication_start_member_state= RECOVERING --source include/start_group_replication.inc --sleep 15 --let $group_replication_member_state= RECOVERING --source ../inc/gr_wait_for_member_state.inc --echo # --echo # 5. Execute something on server 2, it should appear on server 3 --let $rpl_connection_name= server2 --source include/rpl_connection.inc INSERT INTO t1 VALUES (2); --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $wait_condition= SELECT count(*) = 1 FROM information_schema.tables WHERE (table_schema = 'test') AND (table_name = 't1'); --source include/wait_condition.inc --let $wait_condition= SELECT COUNT(*)=1 FROM test.t1; --source include/wait_condition.inc --echo # --echo # 6. Unblock the local transaction on server 1 --let $rpl_connection_name= server_1 --source include/rpl_connection.inc SET @@GLOBAL.DEBUG='-d,group_replication_after_before_commit_hook'; SET DEBUG_SYNC= "now SIGNAL signal.commit_continue"; --let $rpl_connection_name= server1 --source include/rpl_connection.inc --reap --echo # --echo # 7. Server 3 should now be online --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --echo # --echo # 8. Check the logged event order in all servers --let $vcle_seq= Gtid # Query/BEGIN # View_change # Query/COMMIT --let $rpl_connection_name= server1 --source include/rpl_connection.inc # View change (s1) # Create table # View change (s2) # Insert (2) # Insert(1) # View change (s3) --let $event_sequence= $vcle_seq # !Gtid_transaction # $vcle_seq # !Gtid_transaction # !Gtid_transaction # $vcle_seq --source include/assert_binlog_events.inc --let $rpl_connection_name= server2 --source include/rpl_connection.inc # View change (s1) # Create table # View change (s2) # Insert (1) # View change (s3) # Insert(2) --let $event_sequence= $vcle_seq # !Gtid_transaction # $vcle_seq # !Gtid_transaction # $vcle_seq # !Gtid_transaction --source include/assert_binlog_events.inc --let $rpl_connection_name= server3 --source include/rpl_connection.inc # View change (s1) # Create table # View change (s2) # Insert (2) # Insert(1) # View change (s3) --let $event_sequence= $vcle_seq # !Gtid_transaction # $vcle_seq # !Gtid_transaction # !Gtid_transaction # $vcle_seq --source include/assert_binlog_events.inc --echo # --echo # 9. Clean up. --let $rpl_connection_name= server1 --source include/rpl_connection.inc DROP TABLE t1; SET SESSION sql_log_bin= 0; --eval DROP USER "$recovery_user" SET SESSION sql_log_bin= 1; SET SESSION sql_log_bin= 0; call mtr.add_suppression("Timeout when waiting for the server to execute local transactions*"); call mtr.add_suppression("Unable to log the group change View log event in its exaction position in the log.*"); SET SESSION sql_log_bin= 1; --let $rpl_connection_name= server3 --source include/rpl_connection.inc SET SESSION sql_log_bin= 0; call mtr.add_suppression("There was an error when connecting to the donor server.*"); call mtr.add_suppression("For details please check performance_schema.replication_connection_status table and error log messages of Slave I/O for channel group_replication_recovery."); SET SESSION sql_log_bin= 1; --source ../inc/group_replication_end.inc
Save File
Cancel