config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/group_replication/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_recovery_updates.test

################################################################################
# This test intends to see if recovery can handle group updates under specific
# situations.
# It test recovery against group updates when:
#  1) There is no donor information, as Recovery did not choose yet a member
#     of the group.
#  2) Recovery already ended its connection to the donor, and multiple members
#     exited the group before the process is declared as finished.
#
# Test:
# 0. The test requires four servers: M1, M2, M3 and M4.
# 1. Bootstrap start GR on M1. Add some data. Start GR on M2 and M3.
# Phase1: Change the group when the Joiner did not yet choose a Donor.
# 2. Set the debug flag to block recovery on M4. Start GR on M4.
# 3. Stop GR on one of the other member(M2). The recovery process should not
#    be affected. Check the server M2 is no longer member of the group.
# 4. Change the debug stop point for phase 2. Resume the recovery process on M4.
# Phase 2: Change the group after the state exchange in the Joiner ended.
# 5. Restart GR on the stopped member M2.
# 6. Stop 2 servers (M2 and M3) while recovery is not yet stopped.
# 7. Resume recovery on M4: All should be OK.
# 8. Test if the servers (M1 and M4) are working properly by replicating data.
# 9. Clean up.
################################################################################

--source include/big_test.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--let $group_replication_group_name= 850c2d00-edc7-11e4-b80c-0800200c9a66
--source ../inc/have_group_replication_plugin.inc

--let $rpl_server_count= 4
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc

--echo #
--echo # Start group replication on the three servers
--echo # Add some data in to the members
--echo #

--connection server1
--echo server1
--source ../inc/start_and_bootstrap_group_replication.inc

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--connection server2
--echo server2
--source include/start_group_replication.inc


--connection server3
--echo server3
--source include/start_group_replication.inc


--echo #
--echo # Phase 1: Change the group when the Joiner did not yet choose a Donor.
--echo #
--echo # Start group replication on server 4
--echo # Wait right after recovery is declared as running.
--echo #

--connection server4
--echo server4

SET @debug_save= @@GLOBAL.DEBUG;

--echo # Set the debug flag to block recovery
SET @@GLOBAL.DEBUG='d,recovery_thread_start_wait';

--let $group_replication_start_member_state= RECOVERING
--source include/start_group_replication.inc

#sleep to give time for the start to get stuck on recovery
--sleep 5

--echo #
--echo # Stop group replication in one of the other servers
--echo # The recovery process should not be affected.
--echo #

--connection server2
--echo server2
--source include/stop_group_replication.inc

#Get the member uuid
--let $group_member_id= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)

--connection server4
--echo server4

#Check the server is no longer member of the group
let $wait_condition= SELECT COUNT(*)=0 FROM performance_schema.replication_group_members
  WHERE member_id="$group_member_id";
--source include/wait_condition.inc

--echo #
--echo # Resume the recovery process.
--echo # The data should be there when declared online
--echo #

#Change the stop point for phase 2
SET @@GLOBAL.DEBUG= 'd,recovery_thread_wait_before_finish';
#Awake the recovery process
SET DEBUG_SYNC= "now SIGNAL signal.recovery_continue";

#Wait for the data to be there
let $wait_condition= SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't1';
--source include/wait_condition.inc
let $wait_condition= SELECT COUNT(*)=1 FROM t1;
--source include/wait_condition.inc

--echo #
--echo # Phase 2: Change the group after the state exchange in the Joiner ended.
--echo #
--echo # Restart group replication on the stopped member
--echo #

--connection server2
--echo server2
--source include/start_group_replication.inc

--echo #
--echo # Stop 2 servers while recovery is not yet stopped.
--echo #

--connection server2
--echo server2
--source include/stop_group_replication.inc

--connection server3
--echo server3
--source include/stop_group_replication.inc

--echo #
--echo # Resume recovery: All should be OK
--echo #

--connection server4
--echo server4

SET DEBUG_SYNC= "now SIGNAL signal.recovery_end";
SET @@GLOBAL.DEBUG= @debug_save;

--let $group_replication_member_state= ONLINE
--source ../inc/gr_wait_for_member_state.inc

--echo #
--echo # Test if the servers are working properly
--echo #

--connection server1
--echo server1

INSERT INTO t1 VALUES (2);

#sync the servers
--source include/rpl_sync.inc

--connection server4
--echo server4

--let $assert_text= On the recovered member, the table should exist and have 1 elements;
--let $assert_cond= [select count(*) from t1] = 2;
--source include/assert.inc

--echo #
--echo # Clean up
--echo #

--connection server2
--echo server2
--source include/start_group_replication.inc

--connection server3
--echo server3
--source include/start_group_replication.inc

DROP TABLE t1;

--source ../inc/group_replication_end.inc

Man Man