Debian Codegraph @

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

raw
1 ################################################################################
2 # This test checks that group replication applier thread is dependent upon
3 # replica_max_allowed_packet to allow the processing of larger View_change packets.
4 # If the certification database is too big to transmit, all donors will encode
5 # an error instead that will make the joiner fail.
6 #
7 # References:
8 # BUG#26770576: ALL MEMBERS ARE EXITED FROM GR WHEN 1/3 NODE TRIED TO REJOIN AFTER SHUTDOWN
9 # BUG#28443958: ALL MEMBERS ARE EXITED FROM GR WHEN 1/4 NODE TRIED TO REJOIN AFTER NETWORK DROP
10 #
11 # Test:
12 # 0. The test requires two server in multi primary mode
13 # 1. Bootstrap server1 (disable certification database garbage collection).
14 # Set replica_max_allowed_packet to lowest value
15 # 2. Generate 200 transactions on server1 to increase
16 # certification database size.
17 # 3. Start GR on server2, view_change packet will be high in size.
18 # Without certification information, server 2 can't join and moves to ERROR state
19 # 4. Set a bigger value of replica_max_allowed_packet on server1
20 # Restart server2 and see it come ONLINE.
21 # 5. Verification.
22 # 6. Cleanup.
23 ################################################################################
24
25 --source include/big_test.inc
26 --source include/have_debug.inc
27 --source include/have_group_replication_plugin.inc
28 --let $rpl_skip_group_replication_start= 1
29 --source include/group_replication.inc
30
31 --echo
32 --echo # 1. Bootstrap server1 (disable certification database garbage collection).
33 --echo # Set replica_max_allowed_packet to lowest value
34
35 --let $rpl_connection_name= server1
36 --source include/rpl_connection.inc
37 SET @@GLOBAL.DEBUG= '+d,group_replication_do_not_clear_certification_database';
38 SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_big_period';
39 --source include/start_and_bootstrap_group_replication.inc
40
41 SET @debug_save_replica_max_allowed_packet= @@GLOBAL.replica_max_allowed_packet;
42 SET GLOBAL replica_max_allowed_packet=1024;
43
44 --echo
45 --echo # 2. Generate 200 transactions on server1 to increase
46 --echo # certification database size.
47
48 ## We have disabled cleaning of certification database.
49 ## We have limited packet size to 1 KB replica_max_allowed_packet.
50 ## The certification will not be encoded and member2 will
51 ## go to ERROR state if the view change log event to be generated is bigger then
52 ## replica_max_allowed_packet
53 ## As of now size of certification database is growing to approx 13339
54 ## which includes (12+48)*200 and other View_change information.
55
56 --let $rpl_connection_name= server1
57 --source include/rpl_connection.inc
58 CREATE TABLE t1 (a INT PRIMARY KEY);
59 --disable_query_log
60 --let $rows= 200
61 WHILE($rows)
62 {
63 --eval INSERT INTO t1 (a) VALUES ( $rows )
64 --dec $rows
65 }
66 --enable_query_log
67
68 --echo
69 --echo # 3. Start GR on server2, view_change packet will be high in size.
70 --echo # Without certification information, server 2 can't join and moves to ERROR state
71
72 --echo
73 --let $rpl_connection_name= server2
74 --source include/rpl_connection.inc
75
76 --let $wait_timeout= 600
77 --let $group_replication_start_member_state= ERROR
78 --source include/start_group_replication.inc
79
80 # Safety sleep against delays on writing
81 --sleep 1
82
83 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
84 --let $assert_count = 1
85 --let $assert_select = The certification information could not be set in this server: 'Certification information is too large for transmission.'
86 --let $assert_text = Found the expected error about the view change log even being over size
87 --source include/assert_grep.inc
88
89 --echo
90 --echo # 4. Set a bigger value of replica_max_allowed_packet on server1
91 --echo # Restart server2 and see it come ONLINE.
92 --let $rpl_connection_name= server1
93 --source include/rpl_connection.inc
94
95 SET @@GLOBAL.replica_max_allowed_packet=@debug_save_replica_max_allowed_packet;
96
97 --let $rpl_connection_name= server2
98 --source include/rpl_connection.inc
99
100 --source include/stop_group_replication.inc
101 --let $wait_timeout=150
102 --source include/start_group_replication.inc
103
104 --let $rpl_connection_name= server1
105 --source include/rpl_connection.inc
106 --let $group_replication_number_of_members= 2
107 --source include/gr_wait_for_number_of_members.inc
108
109 --echo
110 --echo # 5. Verification.
111
112 --let $diff_tables=server1:t1, server2:t1
113 --source include/diff_tables.inc
114
115 --echo
116 --echo # 6. Cleanup.
117
118 DROP TABLE t1;
119
120 --let $rpl_connection_name= server1
121 --source include/rpl_connection.inc
122 SET @@GLOBAL.DEBUG= '-d,group_replication_do_not_clear_certification_database';
123 SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_big_period';
124
125 --let $rpl_connection_name= server2
126 --source include/rpl_connection.inc
127
128 SET session sql_log_bin=0;
129 call mtr.add_suppression("On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details");
130 call mtr.add_suppression("The certification information could not be set in this server: 'Certification information is too large for transmission.'");
131 call mtr.add_suppression("Error when processing certification information in the incremental recovery process");
132 call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
133 call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
134 call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
135 call mtr.add_suppression("All donors left. Aborting group replication incremental recovery.");
136 call mtr.add_suppression("Skipping leave operation: member already left the group.");
137 SET session sql_log_bin=1;
138
139 --source include/group_replication_end.inc