File: gr_replica_max_allowed_packet_dependency.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (139 lines) | stat: -rw-r--r-- 5,725 bytes parent folder | download
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
################################################################################
# This test checks that group replication applier thread is dependent upon
# replica_max_allowed_packet to allow the processing of larger View_change packets.
# If the certification database is too big to transmit, all donors will encode
# an error instead that will make the joiner fail.
#
# References:
#   BUG#26770576: ALL MEMBERS ARE EXITED FROM GR WHEN 1/3 NODE TRIED TO REJOIN AFTER SHUTDOWN
#   BUG#28443958: ALL MEMBERS ARE EXITED FROM GR WHEN 1/4 NODE TRIED TO REJOIN AFTER NETWORK DROP
#
# Test:
# 0.  The test requires two server in multi primary mode
# 1.  Bootstrap server1 (disable certification database garbage collection).
#     Set replica_max_allowed_packet to lowest value
# 2.  Generate 200 transactions on server1 to increase
#     certification database size.
# 3.  Start GR on server2, view_change packet will be high in size.
#     Without certification information, server 2 can't join and moves to ERROR state
# 4.  Set a bigger value of replica_max_allowed_packet on server1
#     Restart server2 and see it come ONLINE.
# 5.  Verification.
# 6.  Cleanup.
################################################################################

--source include/big_test.inc
--source include/have_debug.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo # 1. Bootstrap server1 (disable certification database garbage collection).
--echo #    Set replica_max_allowed_packet to lowest value

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.DEBUG= '+d,group_replication_do_not_clear_certification_database';
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_big_period';
--source include/start_and_bootstrap_group_replication.inc

SET @debug_save_replica_max_allowed_packet= @@GLOBAL.replica_max_allowed_packet;
SET GLOBAL replica_max_allowed_packet=1024;

--echo
--echo # 2.  Generate 200 transactions on server1 to increase
--echo #     certification database size.

## We have disabled cleaning of certification database.
## We have limited packet size to 1 KB replica_max_allowed_packet.
## The certification will not be encoded and member2 will
## go to ERROR state if the view change log event to be generated is bigger then
## replica_max_allowed_packet
## As of now size of certification database is growing to approx 13339
## which includes (12+48)*200 and other View_change information.

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
CREATE TABLE t1 (a INT PRIMARY KEY);
--disable_query_log
--let $rows= 200
WHILE($rows)
{
  --eval INSERT INTO t1 (a) VALUES ( $rows )
  --dec $rows
}
--enable_query_log

--echo
--echo # 3. Start GR on server2, view_change packet will be high in size.
--echo #    Without certification information, server 2 can't join and moves to ERROR state

--echo
--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--let $wait_timeout= 600
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc

# Safety sleep against delays on writing
--sleep 1

--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_count = 1
--let $assert_select = The certification information could not be set in this server: 'Certification information is too large for transmission.'
--let $assert_text = Found the expected error about the view change log even being over size
--source include/assert_grep.inc

--echo
--echo # 4. Set a bigger value of replica_max_allowed_packet on server1
--echo #    Restart server2 and see it come ONLINE.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc

SET @@GLOBAL.replica_max_allowed_packet=@debug_save_replica_max_allowed_packet;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

--source include/stop_group_replication.inc
--let $wait_timeout=150
--source include/start_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $group_replication_number_of_members= 2
--source include/gr_wait_for_number_of_members.inc

--echo
--echo # 5.  Verification.

--let $diff_tables=server1:t1, server2:t1
--source include/diff_tables.inc

--echo
--echo # 6.  Cleanup.

DROP TABLE t1;

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.DEBUG= '-d,group_replication_do_not_clear_certification_database';
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_big_period';

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

SET session sql_log_bin=0;
call mtr.add_suppression("On shutdown there was a timeout on the Group Replication recovery module termination. Check the log for more details");
call mtr.add_suppression("The certification information could not be set in this server: 'Certification information is too large for transmission.'");
call mtr.add_suppression("Error when processing certification information in the incremental recovery process");
call mtr.add_suppression("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("All donors left. Aborting group replication incremental recovery.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
SET session sql_log_bin=1;

--source include/group_replication_end.inc