File: gr_gno_exhausted.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 (220 lines) | stat: -rw-r--r-- 10,816 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
################################################################################
# Validate that GR behaves properly when group GNOs are exhausted.
# MAX_GNO: 9223372036854775807
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Create a table t1 on both M1 and M2, before starting GR. Validate that
#    transactions are aborted on local member and remote members move to ERROR
#    state when group GNOs are exhausted:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M1.
#  - Bootstrap start GR on M1. Verify GTID_EXECUTED on M1.
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M2.
#  - Start GR on M2. Verify GTID_EXECUTED on M2.
#  - On M1, verify that DML execution failed because GNOs are exhausted.
#  - On M2, verify that member_state is now ERROR.
#  - Verify GTID_EXECUTED=GROUP_UUID:1-9223372036854775806 on both M1 and M2.
#  - Stop GR on M1 and M2.
# 2. Validate that member start moves to ERROR state when GNOs are exhausted:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775806 on M1.
#  - Bootstrap start GR on M1. Verify that member_state is ERROR on M1.
#  - Stop GR on M1.
# 3. Validate that member start moves to ERROR state when GNOs are exhausted on
#    view change log:
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M1.
#  - Bootstrap start GR on M1. Verify GTID_EXECUTED on M1.
#  - Set GTID_PURGED=GROUP_UUID:1-9223372036854775804 on M2.
#  - Start GR on M2. Verify GTID_EXECUTED on M2.
#  - Stop GR on M2. Verify that member_state is ERROR on M1 due to view change
#    log event.
#  - Verify GTID_EXECUTED=GROUP_UUID:1-9223372036854775806 on M1. Stop GR on M1.
# 4. Clean up.
################################################################################
--source include/big_test.inc
--let $group_replication_group_name= c234f752-1ee4-11e6-adee-00212844d44e
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc


# Suppressions and table creation.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
call mtr.add_suppression("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the group with a new group_replication_group_name.");
call mtr.add_suppression("Error at event handling! Got error: 1");
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("The member is leaving a group without being on one.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Unable to ensure the execution of group transactions received during recovery.");
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("Skipping leave operation: member already left the group.");
call mtr.add_suppression("The integer component of the GTID number is high.");
SET SESSION sql_log_bin= 1;
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
call mtr.add_suppression("Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the group with a new group_replication_group_name.");
call mtr.add_suppression("Error at event handling! Got error: 1");
call mtr.add_suppression("Fatal error during execution on the Applier process of Group Replication. The server will now leave the group.");
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("Fatal error during the incremental recovery process of Group Replication. The server will leave the group.");
call mtr.add_suppression("The member is leaving a group without being on one.");
call mtr.add_suppression("The member is already leaving or joining a group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("Skipping leave operation: member already left the group.");
call mtr.add_suppression("The integer component of the GTID number is high.");
SET SESSION sql_log_bin= 1;


--echo
--echo ############################################################
--echo # 1. Validate that transactions are aborted on local member
--echo #    and remote members move to ERROR state when group GNOs
--echo #    are exhausted.
# Set GTID_EXECUTED and start server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775804"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775804
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775804"
--source include/assert.inc

--source include/start_and_bootstrap_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

# Set GTID_EXECUTED and start server 2.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775804"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775804
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775804"
--source include/assert.inc

--source include/start_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

# Exhaust GNOs.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--error ER_TRANSACTION_ROLLBACK_DURING_COMMIT
INSERT INTO t1 VALUES (1);
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $group_replication_member_state= ERROR
--source include/gr_wait_for_member_state.inc
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc
--source include/stop_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/stop_group_replication.inc


--echo
--echo ############################################################
--echo # 2. Validate that member start moves to ERROR state when
--echo #    group GNOs are exhausted.
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775806"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

--source include/gr_set_bootstrap_group.inc
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc
--source include/gr_clear_bootstrap_group.inc

--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc

--source include/stop_group_replication.inc


--echo ############################################################
--echo # 3. Validate that member moves to ERROR state when group
--echo #    GNOs are exhausted on view change log.
# Set GTID_EXECUTED and start server 1.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775805"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

--source include/start_and_bootstrap_group_replication.inc
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775806
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775806"
--source include/assert.inc

# Set GTID_EXECUTED and start server 2.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
RESET MASTER;
--eval SET GLOBAL GTID_PURGED= "$group_replication_group_name:1-9223372036854775805"
--let $assert_text= GTID_EXECUTED must be UUID:1-9223372036854775805
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-9223372036854775805"
--source include/assert.inc

# Server 2 joins the group.
# Since server 1 cannot log the new view change event it will leave the group
# Server 2 will leave the group as there are no available donors.
--let $group_replication_start_member_state= ERROR
--source include/start_group_replication.inc

# Server2 GTIDs cannot be checked, because server1 may send some data on recovery
# but it can also leave before that.

--source include/stop_group_replication.inc

# On server 1 view change log event is tried to be logged, what will exhaust group GNOs.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $group_replication_member_state= ERROR
--source include/gr_wait_for_member_state.inc

--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "$group_replication_group_name:1-9223372036854775806"
--source include/wait_condition.inc
--source include/stop_group_replication.inc


--echo
--echo ############################################################
--echo # 4. Clean up.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
RESET MASTER;
--source include/start_and_bootstrap_group_replication.inc
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
RESET MASTER;
--source include/start_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
DROP TABLE t1;
SET SESSION sql_log_bin= 1;

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET SESSION sql_log_bin= 0;
DROP TABLE t1;
SET SESSION sql_log_bin= 1;

--source include/group_replication_end.inc