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

################################################################################
# ==== Purpose ====
#
# This test will setup a group with only two members to ensure that the GR
# works regardless of performance-schema being enabled or not.
#
# It will first generate some workload in a single member. It will then
# make the other member to join the group and recover. Once having the two
# members in the group, the test case will generate workload to be certified.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#23291352 GROUP REPLICATION SEGFAULTS WHEN PERFORMANCE_SCHEMA=OFF
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. On M1, create a table and data to be recovered.
# 2. Bootstrap start a group on M1.
# 3. Start GR on M2 and wait until recovered.
# 4. Check if GR works fine: generate workload to be certified/replicated.
# 5. Clean up: stop group replication on both members.
################################################################################

--source include/not_windows.inc
--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc

--echo
--echo ####################################################################
--echo # 1. Create a table on server1 and generate workload to be recovered
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--echo
--echo #################################################################
--echo # 2. Start group replication on server1, bootstrapping the group
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
--source ../inc/gr_set_bootstrap_group.inc
START GROUP_REPLICATION;
--source ../inc/gr_clear_bootstrap_group.inc

--echo
--echo #################################################################
--echo # 3. Start group replication on server2 and wait until recovered
--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
START GROUP_REPLICATION;

--echo Wait until server2 recovered table t1
--let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.tables WHERE TABLE_SCHEMA="test" AND TABLE_NAME="t1";
--source include/wait_condition.inc

--echo Wait until server2 recovered the single row of table t1
--let $wait_condition= SELECT COUNT(*)=1 FROM t1
--source include/wait_condition.inc

--echo Wait until server2 recovery has finished
--let $wait_condition= SELECT @@GLOBAL.super_read_only = '0'
--source include/wait_condition.inc

--echo
--echo #########################################################################
--echo # 4. Check if GR works fine: generate workload to be certified/replicated
INSERT INTO t1 VALUES (2);

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--echo Wait until server1 has the table with 2 rows
--let $wait_condition= SELECT COUNT(*)=2 FROM t1
--source include/wait_condition.inc

DROP TABLE t1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--echo Wait until server2 has dropped table t1
--let $wait_condition= SELECT COUNT(*)=0 FROM information_schema.tables WHERE TABLE_SCHEMA="test" AND TABLE_NAME="t1";
--source include/wait_condition.inc

--echo
--echo #####################################################
--echo # 5. Clean up: stop group replication on both members
STOP GROUP_REPLICATION;
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
STOP GROUP_REPLICATION;
--source ../inc/group_replication_end.inc

Man Man