← Back
Editing: gr_stop_gr_during_dml_01.test
############################################################################### # WL#9053 # Stop group replication on a (M3)particular member when some DML's are # happening on M1 # Test: # 0. This test requires 3 servers M1, M2 and M3 # M1 -> server1, M2 -> server2, M3 -> server3 # 1. Start 3 servers and add them into group replication group # 2. Start a insert operation on M1 which inserts 500 records # using "send call" # 3. Perform stop group replication on M3 in parallel # client when inserts are happening on M1 # 4. Check the number of servers online and status of servers(M1,M2,M3) # 5. Start group replication again on M3 and check the status # 6. Validate the record counts on different tables # 7. Cleanup ################################################################################ --source include/big_test.inc --source ../inc/have_group_replication_plugin.inc --let $rpl_server_count= 3 --source ../inc/group_replication.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc CREATE TABLE test.t1 ( a int primary key); --source include/rpl_sync.inc USE test; delimiter $$; CREATE PROCEDURE insert_into_t1() BEGIN declare x INT; set x=1; while x<500 do insert into t1 values (x); set x=x+1; end while; end$$ delimiter ;$$ --echo # Start a insert operation in parallel client on server1 --echo ----call procedure---- --send call insert_into_t1() --echo # # Stop group replication on server3 once atleast 50 records are inserted and synched # --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $wait_condition= SELECT COUNT(*)>=50 FROM test.t1 --source include/wait_condition.inc --echo ###### Stop the group replication on server3 ###### --source include/stop_group_replication.inc #reap has been done after send --let $rpl_connection_name= server1 --source include/rpl_connection.inc --reap # Check the no of online servers by connecting client to server 1 and server2 --echo ####### Checking the member count having online status ####### --let $wait_condition=SELECT COUNT(*)=2 FROM performance_schema.replication_group_members where MEMBER_STATE="ONLINE" --source include/wait_condition.inc --echo --let $rpl_connection_name= server2 --source include/rpl_connection.inc --echo ####### Checking the member count having online status ####### --let $wait_condition=SELECT COUNT(*)=2 FROM performance_schema.replication_group_members where MEMBER_STATE="ONLINE" --source include/wait_condition.inc CREATE TABLE test.t2 ( a int primary key); --disable_query_log --let $i=10 while($i) { --EVAL INSERT INTO t2 VALUES ($i) --dec $i } --enable_query_log # Start the group replication again and check the status --echo --let $rpl_connection_name= server3 --source include/rpl_connection.inc --let $wait_timeout= 600 --source include/start_group_replication.inc # Validate the record count in all the tables in server3 --echo ##### validating the records in server3 ##### --let $assert_text= 'Checking the number of records in test.t1' --let $assert_cond= [SELECT COUNT(*) as count FROM test.t1,count, 1] = 499 --source include/assert.inc --let $assert_text= 'Checking the number of records in test.t2' --let $assert_cond= [SELECT COUNT(*) as count FROM test.t2,count, 1] = 10 --source include/assert.inc DROP TABLE test.t1; DROP PROCEDURE insert_into_t1; DROP TABLE test.t2; --source ../inc/group_replication_end.inc
Save File
Cancel