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

################################################################################
# WL#6833: GCS Replication: Read-set free Certification
#          Module (DBSM Snapshot Isolation)
#
# Scenario 1: Set GTID_NEXT on a client session
#
# Verify Group Replication behaviour when a GTID_NEXT is
# specified on a transaction.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. With both members ONLINE. Execute some transactions on M1 with and without
#    GTID_NEXT specified.
# 2. Execute some transactions on M2 with and without GTID_NEXT specified.
# 3. Check that GTID_EXECUTED on M1 contains all transactions. Also check that
#    data is on tables.
# 4. Check that GTID_EXECUTED on M2 contains all transactions. Also check that
#    data is on tables.
# 5. Wait for stable set propagation and certification info garbage collection.
# 6. Check that stable set and certification info size are properly updated
#    after stable set propagation and certification info garbage collection on
#    M1.
# 7. Check that stable set and certification info size are properly updated
#    after stable set propagation and certification info garbage collection on
#    M2.
# 8. Clean up.
################################################################################

--source include/big_test.inc
--source ../inc/have_group_replication_gtid_assignment_block_size_1.inc
--let $group_replication_group_name= 8a94f357-aab4-11df-86ab-c80aa9429489
--source ../inc/have_group_replication_plugin.inc
--source ../inc/group_replication.inc

# Keep binary logs with only GTIDs from test.
--connection server1
SET SESSION sql_log_bin= 0;
--source include/gtid_utils.inc
SET SESSION sql_log_bin= 1;
--connection server2
SET SESSION sql_log_bin= 0;
--source include/gtid_utils.inc
SET SESSION sql_log_bin= 1;

--let $expected_gtid_set= "8a94f357-aab4-11df-86ab-c80aa9429489:1-6,aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1-2,bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb:1-3"


--echo
--echo ############################################################
--echo # 1. Execute some transactions on server 1 with and without
--echo #    GTID specified.
--connection server1
--eval SET GTID_NEXT= '$uuida:1'
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
SET GTID_NEXT= 'AUTOMATIC';

INSERT INTO t1 VALUES (1);


--echo
--echo ############################################################
--echo # 2. Execute some transactions on server 2  with and without
--echo #    GTID specified (including empty transactions).
--connection server2
CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;

--source include/rpl_sync.inc
--eval SET GTID_NEXT= '$uuida:2'
INSERT INTO t1 VALUES (2);
SET GTID_NEXT= 'AUTOMATIC';

--eval SET GTID_NEXT= '$uuidb:1'
INSERT INTO t2 VALUES (1);
SET GTID_NEXT= 'AUTOMATIC';

--eval SET GTID_NEXT= '$uuidb:2'
INSERT INTO t2 VALUES (2);
SET GTID_NEXT= 'AUTOMATIC';

--eval SET GTID_NEXT= '$uuidb:3'
BEGIN;
COMMIT;
SET GTID_NEXT= 'AUTOMATIC';

INSERT INTO t1 VALUES (3);
INSERT INTO t2 VALUES (3);

--source include/rpl_sync.inc


--echo
--echo ############################################################
--echo # 3. Check that GTID_EXECUTED on server 1 contains all
--echo #    transactions.
--echo #    Also check that data is on tables.
--connection server1
--let $assert_text= GTID_EXECUTED must contain all committed GTIDs
--let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, $expected_gtid_set)
--source include/assert.inc

--let $assert_text= 'There is a value 1 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 2, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 3 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 3, count, 1] = 1
--source include/assert.inc

--let $assert_text= 'There is a value 1 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 2, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 3 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 3, count, 1] = 1
--source include/assert.inc


--echo
--echo ############################################################
--echo # 4. Check that GTID_EXECUTED on server 2 contains all
--echo #    transactions.
--echo #    Also check that data is on tables.
--connection server2
--let $assert_text= GTID_EXECUTED must contain all committed GTIDs
--let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, $expected_gtid_set)
--source include/assert.inc

--let $assert_text= 'There is a value 1 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 2, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 3 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 3, count, 1] = 1
--source include/assert.inc

--let $assert_text= 'There is a value 1 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 2, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 3 in table t2'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t2 WHERE t2.c1 = 3, count, 1] = 1
--source include/assert.inc


--echo
--echo ############################################################
--echo # 5. Wait for stable set propagation and certification info
--echo #    garbage collection.
--connection server1
--let $wait_timeout= 65
--let $wait_condition= SELECT Transactions_committed_all_members<>"" FROM performance_schema.replication_group_member_stats
--source include/wait_condition.inc


--echo
--echo ############################################################
--echo # 6. Check that stable set and certification info size are
--echo #    properly updated after stable set propagation and
--echo #    certification info garbage collection on server 1.
--connection server1

--let $count_transactions_validating= query_get_value(SELECT Count_transactions_rows_validating from performance_schema.replication_group_member_stats, Count_transactions_rows_validating, 1)
--let $assert_text= 'Count_transactions_rows_validating must be 2'
--let $assert_cond= $count_transactions_validating = 2
--source include/assert.inc

--let $transactions_committed_all_members= query_get_value(SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats, Transactions_committed_all_members, 1)
--let $assert_text= 'Transactions_committed_all_members must be equal to GTID_EXECUTED'
--let $assert_cond= GTID_IS_EQUAL("$transactions_committed_all_members", $expected_gtid_set)
--source include/assert.inc


--echo
--echo ############################################################
--echo # 7. Check that stable set and certification info size are
--echo #    properly updated after stable set propagation and
--echo #    certification info garbage collection on server 2.
--connection server2

--let $count_transactions_validating= query_get_value(SELECT Count_transactions_rows_validating from performance_schema.replication_group_member_stats, Count_transactions_rows_validating, 1)
--let $assert_text= 'Count_transactions_rows_validating must be 2'
--let $assert_cond= $count_transactions_validating = 2
--source include/assert.inc

--let $transactions_committed_all_members= query_get_value(SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats, Transactions_committed_all_members, 1)
--let $assert_text= 'Transactions_committed_all_members must be equal to GTID_EXECUTED'
--let $assert_cond= GTID_IS_EQUAL("$transactions_committed_all_members", $expected_gtid_set)
--source include/assert.inc


--echo
--echo ############################################################
--echo # 8. Shutdown.
DROP TABLE t1;
DROP TABLE t2;

--connection server1
SET SESSION sql_log_bin= 0;
--source include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;
--connection server2
SET SESSION sql_log_bin= 0;
--source include/gtid_utils_end.inc
SET SESSION sql_log_bin= 1;

--source ../inc/group_replication_end.inc

Man Man