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_gno_exhausted.test

################################################################################
# Validate that GR behaves properly when group GNOs are exhausted.
# MAX_GNO: 9223372036854775807
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Create a table t1 on both M1 and M2, before starting GR. Validate that
#    transactions are aborted on local member and remote members move to ERROR
#    state when group GNOs are exhausted:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M1.
#  - Bootstrap start GR on M1. Verify GTID_EXECUTED on M1.
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M2.
#  - Start GR on M2. Verify GTID_EXECUTED on M2.
#  - On M1, verify that DML execution failed because GNOs are exhausted.
#  - On M2, verify that member_state is now ERROR.
#  - Verify GTID_EXECUTED=GROUP_UUID:1-9223372036854775806 on both M1 and M2.
#  - Stop GR on M1 and M2.
# 2. Validate that member start moves to ERROR state when GNOs are exhausted:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775806 on M1.
#  - Bootstrap start GR on M1. Verify that member_state is ERROR on M1.
#  - Stop GR on M1.
# 3. Validate that member start moves to ERROR state when GNOs are exhausted on
#    view change log:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M1.
#  - Bootstrap start GR on M1. Verify GTID_EXECUTED on M1.
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M2.
#  - Start GR on M2. Verify GTID_EXECUTED on M2.
#  - Stop GR on M2. Verify that member_state is ERROR on M1 due to view change
#    log event.
#  - Verify GTID_EXECUTED=GROUP_UUID:1-9223372036854775806 on M1. Stop GR on M1.
# 4. Clean up.
################################################################################
--source include/big_test.inc
--let $group_replication_group_name= c234f752-1ee4-11e6-adee-00212844d44e
--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc


# Suppressions and table creation.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
call mtr.add_suppression("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the group with a new group_replication_group_name.");
call mtr.add_suppression("Error at event handling! Got error: 1");
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("The member is leaving a group without being on one.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("It is not possible to ensure the execution of group transactions received during recovery.");
call mtr.add_suppression("Fatal error during the Recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
SET SESSION sql_log_bin= 1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
call mtr.add_suppression("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the group with a new group_replication_group_name.");
call mtr.add_suppression("Error at event handling! Got error: 1");
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("All donors left. Aborting group replication recovery.");
call mtr.add_suppression("Fatal error during the Recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("The member is leaving a group without being on one.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
SET SESSION sql_log_bin= 1;


--echo
--echo ############################################################
--echo # 1. Validate that transactions are aborted on local member
--echo #    and remote members move to ERROR state when group GNOs
--echo #    are exhausted.
# Set GTID_EXECUTED and start server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775804"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775804
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775804"
--source include/assert.inc

--source ../inc/start_and_bootstrap_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

# Set GTID_EXECUTED and start server 2.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775804"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775804
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775804"
--source include/assert.inc

--source include/start_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

# Exhaust GNOs.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--error ER_TRANSACTION_ROLLBACK_DURING_COMMIT
INSERT INTO t1 VALUES (1);
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $group_replication_member_state= ERROR
--source ../inc/gr_wait_for_member_state.inc
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc
--source include/stop_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/stop_group_replication.inc


--echo
--echo ############################################################
--echo # 2. Validate that member start moves to ERROR state when
--echo #    group GNOs are exhausted.
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775806"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

--source ../inc/gr_set_bootstrap_group.inc
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc
--source ../inc/gr_clear_bootstrap_group.inc

--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc

--source include/stop_group_replication.inc


--echo ############################################################
--echo # 3. Validate that member moves to ERROR state when group
--echo #    GNOs are exhausted on view change log.
# Set GTID_EXECUTED and start server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775805"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

--source ../inc/start_and_bootstrap_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

# Set GTID_EXECUTED and start server 2.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775805"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

# Server 2 joins the group.
# Since server 1 cannot log the new view change event it will leave the group
# Server 2 will leave the group as there are no available donors.
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc

# Server2 GTIDs cannot be checked, because server1 may send some data on recovery
# but it can also leave before that.

--source include/stop_group_replication.inc

# On server 1 view change log event is tried to be logged, what will exhaust group GNOs.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $group_replication_member_state= ERROR
--source ../inc/gr_wait_for_member_state.inc

--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc
--source include/stop_group_replication.inc


--echo
--echo ############################################################
--echo # 4. Clean up.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
DROP TABLE t1;
SET SESSION sql_log_bin= 1;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
DROP TABLE t1;
SET SESSION sql_log_bin= 1;

--source ../inc/group_replication_end.inc

Man Man