Debian Codegraph @

mysql-test/suite/group_replication/t/gr_last_conflict_free_transaction.test

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