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

#
# Check that Group Replication parallel applier parallelization
# indexes are corrected according to WL#8440.
#
# Steps:
# 1.  Setup a new group with four members.
#     Execute some transactions on member 1, 2 and 3 that will
#     be applied on member 4 through Group Replication applier.
#     Dump Group Replication applier channel relay log and
#     validate its indexes on member 4.
# 2.  Stop and start member 2 to force a relay log flush.
#     Start member 1 again and execute another transactions
#     on members 1 and 2.
#     Purpose of the test: show that local transactions do
#     not interfere with remote transactions, the ones that
#     go through parallel applier.
#     Dump Group Replication applier channel relay log and
#     validate its indexes on members 2 and 1.
# 3.  Wait for stable set propagation and certification info
#     garbage collection.
#     Execute some more transactions and assert that
#     last_committed index was update with previous
#     sequence_number, even when transactions do not
#     depend on previous transactions.
#     Dump Group Replication applier channel relay log and
#     validate its indexes on members 2 and 1.
# 4.  Test cleanup.
#
--source include/big_test.inc
--source ../inc/have_group_replication_plugin.inc

--echo
--echo ############################################################
--echo # 1.  Setup a new group with four members.
--echo #     Four view_change transactions will be logged on member
--echo #     4. All these transactions, when seen on member 4, will
--echo #     have indexes:
--echo #     server_id=4, last_committed=0, sequence_number=0
--echo #
--let $rpl_server_count= 4
--source ../inc/group_replication.inc

--echo
--echo # Execute some transactions on member 1, 2 and 3 that will
--echo # be applied on member 4 through Group Replication applier.
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Transactions with empty write set need to be executed sequentially,
# so last_committed of this and next transaction are incremented.
# server_id=1, last_committed=4, sequence_number=5
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
--source include/rpl_sync.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Since previous transaction didn't have write set, last_committed
# was incremented.
# server_id=2, last_committed=5, sequence_number=6
SET GTID_NEXT= 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1';
INSERT INTO t1 VALUES (1);
SET GTID_NEXT= AUTOMATIC;
--source include/rpl_sync.inc

--let $rpl_connection_name= server3
--source include/rpl_connection.inc
# No dependencies from last transaction, last_committed is the same.
# server_id=1, last_committed=5, sequence_number=7
INSERT INTO t1 VALUES (3);

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Dependencies found, last_committed will be updated.
# server_id=1, last_committed=6, sequence_number=8
UPDATE t1 SET c1=2 WHERE c1=1;
--source include/rpl_sync.inc

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


--echo
--echo # Dump Group Replication applier channel relay log and
--echo # validate its indexes on member 4.
--echo #
--let $rpl_connection_name= server4
--source include/rpl_connection.inc

--let $dump_file=$MYSQLTEST_VARDIR/tmp/group_replication_parallel_applier_indexes.dump
--exec $MYSQL_BINLOG --force-if-open $server_4_datadir/server-relay-log-group_replication_applier.000002 > $dump_file
--let $grep_file= $dump_file
--let $grep_pattern= last_committed
--let $grep_output= print_each
--replace_regex /# at [0-9]*/# at #/ /#[0-9]+/#time#/ /[[:space:]]+[0-9]+:[0-9]+:[0-9]+/ ##:##:##/ /end_log_pos [0-9]+/end_log_pos ##/
--source include/grep_pattern.inc

--let $binlog_file= server-relay-log-group_replication_applier.000002
--let $logical_timestamps= 0 0;0 0;0 0;0 0;4 5;5 6;5 7;6 8
--source include/assert_logical_timestamps.inc


--echo
--echo ############################################################
--echo # 2.  Stop and start member 2 to force a relay log flush.
--echo #     Start member 1 again and execute another transactions
--echo #     on members 1 and 2.
--echo #     Purpose of the test: show that local transactions do
--echo #     not interfere with remote transactions, the ones that
--echo #     go through parallel applier.
--echo #
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/stop_group_replication.inc
# server_id=2, last_committed=0, sequence_number=0
--source include/start_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# server_id=1, last_committed=0, sequence_number=0
--source include/start_group_replication.inc

--let $rpl_connection_name= server3
--source include/rpl_connection.inc
# Server 1: server_id=3, last_committed=1, sequence_number=2
# Server 2: server_id=3, last_committed=2, sequence_number=3
INSERT INTO t1 VALUES (4);
--source include/rpl_sync.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# This transaction does not increment server 2 last_committed
# or sequence_number indexes, but increments them on server 1.
# Server 1: last_committed=2 sequence_number=3
# Server 2: No effect
UPDATE t1 SET c1=5 WHERE c1=4;
--source include/rpl_sync.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# This transaction does not increment server 1 last_committed
# or sequence_number indexes.
# Server 1: No effect
# Server 2: last_committed=2 sequence_number=4
INSERT INTO t1 VALUES (6);
--source include/rpl_sync.inc

--let $rpl_connection_name= server4
--source include/rpl_connection.inc
# Server 1: server_id=4, last_committed=1, sequence_number=4
# Server 2: server_id=4, last_committed=4, sequence_number=5
UPDATE t1 SET c1=7 WHERE c1=6;
--source include/rpl_sync.inc


--echo
--echo # Dump Group Replication applier channel relay log and
--echo # validate its indexes on member 2.
--echo #
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--exec $MYSQL_BINLOG --force-if-open $server_2_datadir/server-relay-log-group_replication_applier.000003 > $dump_file
--replace_regex /# at [0-9]*/# at #/ /#[0-9]+/#time#/ /[[:space:]]+[0-9]+:[0-9]+:[0-9]+/ ##:##:##/ /end_log_pos [0-9]+/end_log_pos ##/
--source include/grep_pattern.inc

--let $binlog_file= server-relay-log-group_replication_applier.000003
--let $logical_timestamps= 0 0;0 0;2 3;2 4;4 5
--source include/assert_logical_timestamps.inc

--echo
--echo # Dump Group Replication applier channel relay log and
--echo # validate its indexes on member 1.
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--exec $MYSQL_BINLOG --force-if-open $server_1_datadir/server-relay-log-group_replication_applier.000003 > $dump_file
--replace_regex /# at [0-9]*/# at #/ /#[0-9]+/#time#/ /[[:space:]]+[0-9]+:[0-9]+:[0-9]+/ ##:##:##/ /end_log_pos [0-9]+/end_log_pos ##/
--source include/grep_pattern.inc

--let $binlog_file= server-relay-log-group_replication_applier.000003
--let $logical_timestamps= 0 0;1 2;2 3;1 4
--source include/assert_logical_timestamps.inc


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

--echo
--echo # Execute some more transactions and assert that
--echo # last_committed index was update with previous
--echo # sequence_number, even when transactions do not
--echo # depend on previous transactions.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# Server 1: No effect
# Server 2: server_id=1, last_committed=6, sequence_number=7
INSERT INTO t1 VALUES (8);

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
# Server 1: server_id=2, last_committed=5, sequence_number=6
# Server 2: No effect
INSERT INTO t1 VALUES (9);
--source include/rpl_sync.inc

--echo
--echo # Dump Group Replication applier channel relay log and
--echo # validate its indexes on member 2.
--echo #
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--exec $MYSQL_BINLOG --force-if-open $server_2_datadir/server-relay-log-group_replication_applier.000003 > $dump_file
--replace_regex /# at [0-9]*/# at #/ /#[0-9]+/#time#/ /[[:space:]]+[0-9]+:[0-9]+:[0-9]+/ ##:##:##/ /end_log_pos [0-9]+/end_log_pos ##/
--source include/grep_pattern.inc

--let $binlog_file= server-relay-log-group_replication_applier.000003
--let $logical_timestamps= 0 0;0 0;2 3;2 4;4 5;6 7
--source include/assert_logical_timestamps.inc

--echo
--echo # Dump Group Replication applier channel relay log and
--echo # validate its indexes on member 1.
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--exec $MYSQL_BINLOG --force-if-open $server_1_datadir/server-relay-log-group_replication_applier.000003 > $dump_file
--replace_regex /# at [0-9]*/# at #/ /#[0-9]+/#time#/ /[[:space:]]+[0-9]+:[0-9]+:[0-9]+/ ##:##:##/ /end_log_pos [0-9]+/end_log_pos ##/
--source include/grep_pattern.inc

--let $binlog_file= server-relay-log-group_replication_applier.000003
--let $logical_timestamps= 0 0;1 2;2 3;1 4;5 6
--source include/assert_logical_timestamps.inc


--echo
--echo ############################################################
--echo # 4.  Test cleanup.
DROP TABLE t1;
--source ../inc/group_replication_end.inc
--remove_file $dump_file

Man Man