Debian Codegraph @

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

raw
1 ################################################################################
2 # Verify that applier channel received_transaction_set does not grow infinitely
3 # with holes.
4 #
5 # Test:
6 # 0. The test requires two servers: M1 and M2.
7 # 1. Create a table t1 on a GROUP.
8 # 2. Execute some transactions on both members. Transactions executed on M1
9 # will be on M2 applier channel received_transaction_set, and the dual for
10 # M2 transactions.
11 # 3. Assert check that both members have holes on its applier channel
12 # received_transaction_set. The holes are expected and despite them members
13 # data is equal.
14 # 4. Wait for stable set propagation and certification info garbage collection.
15 # When that happens, the holes on applier channel will be filled.
16 # 5. Assert check that both members do not have holes on their applier channel
17 # received_transaction_set.
18 # 6. Clean up.
19 ################################################################################
20 --source include/big_test.inc
21 --source include/have_group_replication_gtid_assignment_block_size_1.inc
22 --source include/have_group_replication_plugin.inc
23 --source include/group_replication.inc
24
25
26 --echo
27 --echo ############################################################
28 --echo # 1. Create a table on the group.
29 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
30 --source include/rpl_sync.inc
31
32
33 --echo
34 --echo ############################################################
35 --echo # 2. Execute some transactions on both members.
36 --echo # Transactions executed on member 1 will be on member 2
37 --echo # applier channel received_transaction_set, and the dual
38 --echo # for member 2 transactions.
39 --disable_query_log
40 --let $transactions= 10
41 while ($transactions > 0)
42 {
43 --connection server1
44 --eval INSERT INTO t1 VALUES ($transactions)
45 --dec $transactions
46
47 --connection server2
48 --eval INSERT INTO t1 VALUES ($transactions)
49 --dec $transactions
50 }
51 --enable_query_log
52 --source include/rpl_sync.inc
53
54
55 --echo
56 --echo ############################################################
57 --echo # 3. Assert that both members have holes on its applier
58 --echo # channel received_transaction_set.
59 --echo # The holes are expected and despite them members data is
60 --echo # equal.
61 --let $rpl_connection_name= server1
62 --source include/rpl_connection.inc
63 --let $received_transaction_set= query_get_value(SELECT received_transaction_set FROM performance_schema.replication_connection_status WHERE channel_name="group_replication_applier", received_transaction_set, 1)
64 --let $assert_text= The value of received_transaction_set must have holes
65 --let $assert_cond= "$received_transaction_set" = "$group_replication_group_name:2:5:7:9:11:13"
66 --source include/assert.inc
67
68 --let $rpl_connection_name= server2
69 --source include/rpl_connection.inc
70 --let $received_transaction_set= query_get_value(SELECT received_transaction_set FROM performance_schema.replication_connection_status WHERE channel_name="group_replication_applier", received_transaction_set, 1)
71 --let $assert_text= The value of received_transaction_set must have holes
72 --let $assert_cond= "$received_transaction_set" = "$group_replication_group_name:1-4:6:8:10:12"
73 --source include/assert.inc
74
75 --let $diff_tables= server1:test.t1, server2:test.t1
76 --source include/diff_tables.inc
77
78
79 --echo
80 --echo ############################################################
81 --echo # 4. Wait for stable set propagation and certification info
82 --echo # garbage collection. When that happens, the holes on
83 --echo # applier channel will be filled.
84
85 --let $rpl_connection_name= server1
86 --source include/rpl_connection.inc
87
88 --let $wait_timeout= 90
89 --let $wait_condition= SELECT transactions_committed_all_members<>"" FROM performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)
90 --source include/wait_condition.inc
91
92
93 --echo
94 --echo ############################################################
95 --echo # 5. Assert that both members dot not have holes on their
96 --echo # applier channel received_transaction_set.
97 --let $rpl_connection_name= server1
98 --source include/rpl_connection.inc
99 --let $received_transaction_set= query_get_value(SELECT received_transaction_set FROM performance_schema.replication_connection_status WHERE channel_name="group_replication_applier", received_transaction_set, 1)
100 --let $assert_text= The value of received_transaction_set must not have holes
101 --let $assert_cond= "$received_transaction_set" = "$group_replication_group_name:1-13"
102 --source include/assert.inc
103
104 --let $rpl_connection_name= server2
105 --source include/rpl_connection.inc
106 --let $received_transaction_set= query_get_value(SELECT received_transaction_set FROM performance_schema.replication_connection_status WHERE channel_name="group_replication_applier", received_transaction_set, 1)
107 --let $assert_text= The value of received_transaction_set must not have holes
108 --let $assert_cond= "$received_transaction_set" = "$group_replication_group_name:1-13"
109 --source include/assert.inc
110
111
112 --echo
113 --echo ############################################################
114 --echo # 6. Clean up.
115 DROP TABLE t1;
116 --source include/group_replication_end.inc