1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
################################################################################
# Validate that column last_conflict_free_transaction from
# performance_schema.replication_group_member_stats table
# always show the last conflict free transaction.
#
# Steps:
# 0. The test requires two servers: M1 and M2.
# 1. With both members ONLINE. Assert that last_conflict_free_transaction is
# correct when last transaction GTID was generated on M1 and M2.
# 2. Assert that last_conflict_free_transaction is correct
# when last transaction GTID was specified on M1 and M2.
# 3. Clean up.
################################################################################
--source include/have_group_replication_plugin.inc
--source include/group_replication.inc
--echo
--echo ############################################################
--echo # 1. Assert that last_conflict_free_transaction is correct
--echo # when last transaction GTID was generated.
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
--source include/rpl_sync.inc
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $assert_text= On server1, the value of last_conflict_free_transaction must be the last positively certified transaction (group generated)
# Transaction GNO is 3 since 1 and 2 were used on view change log events for server 1 and 2 join.
--let $assert_cond= "[SELECT last_conflict_free_transaction FROM performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" = "$group_replication_group_name:3"
--source include/assert.inc
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $assert_text= On server2, the value of last_conflict_free_transaction must be the last positively certified transaction (group generated)
--let $assert_cond= "[SELECT last_conflict_free_transaction FROM performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" = "$group_replication_group_name:3"
--source include/assert.inc
--echo
--echo ############################################################
--echo # 2. Assert that last_conflict_free_transaction is correct
--echo # when last transaction GTID was specified.
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= server1
--source include/rpl_connection.inc
--let $assert_text= On server1, the value of last_conflict_free_transaction must be the last positively certified transaction (specified GTID)
--let $assert_cond= "[SELECT last_conflict_free_transaction FROM performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1"
--source include/assert.inc
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $assert_text= On server2, the value of last_conflict_free_transaction must be the last positively certified transaction (specified GTID)
--let $assert_cond= "[SELECT last_conflict_free_transaction FROM performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1"
--source include/assert.inc
--echo
--echo ############################################################
--echo # 3. Clean up.
DROP TABLE t1;
--source include/group_replication_end.inc
|