File: gr_applier_and_shutdown.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 (104 lines) | stat: -rw-r--r-- 4,987 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
##############################################################################
#
# This test validates parallel shutdown of all members is safe.
# When shutdown happens 2 parallel things may happen in group replication.
# View change may happen due to member shutdown and applier may stop due to
# kill received from shutdown operation.
# This test makes sure above mentioned parallel operations are handled properly.
#
# Test:
# 0. The test requires two servers: M1(primary) and M2(secondary).
# 1. Start GR on server1 & server2.
# 2. Add debug point to
#    2.1. make sure primary change fails on server2.
#    2.2. delay primary change operation to allow shutdown to send KILL signals
#    2.3. block applier processing so suspension packets is not processed
# 3. Stop GR on server1, server2 become primary
# 4. Primary change happens on server2 but is delayed with help of
#    group_replication_wait_for_current_events_execution_fail debug point.
# 5. Execute shutdown so that applier threads receives the KILL signal.
# 6. Cleanup
##############################################################################

# Do not run on valgrind due to restart and sleeps used.
--source include/not_valgrind.inc
# Big-test due to restart of server
--source include/big_test.inc
--source include/have_debug_sync.inc
--source include/have_group_replication_plugin.inc
--let $rpl_group_replication_single_primary_mode=1
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo # 1. Start GR on server1 & server2.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc

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

SET SESSION sql_log_bin = 0;
call mtr.add_suppression("There was an issue on the primary election process: Could not wait for the execution of local transactions. The member will now leave the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("The group replication applier thread has received KILL request.");
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("Skipping leave operation: member already left the group.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Error, maximum number of retries exceeded when waiting for the internal server session state to be operating");
call mtr.add_suppression("Failed to establish an internal server connection to execute plugin operations");
SET SESSION sql_log_bin = 1;
--source include/start_group_replication.inc

--echo
--echo # 2. Add debug point to
--echo #    2.1. make sure primary change fails on server2.
--echo #    2.2. delay primary change operation to allow shutdown to send KILL signals
--echo #    2.3. block applier processing so suspension packets is not processed

SET @@GLOBAL.DEBUG= '+d,group_replication_wait_for_current_events_execution_fail';

--echo
--echo # 3. Stop GR on server1, server2 become primary

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

--source include/stop_group_replication.inc

--echo
--echo # 4. Primary change happens on server2 but is delayed with help of
--echo #    group_replication_wait_for_current_events_execution_fail debug point.

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

SET DEBUG_SYNC= "now WAIT_FOR signal.group_replication_wait_for_current_events_execution_fail_applier_add_suspension_packet";

--echo
--echo # 5. Execute shutdown so that applier threads receives the KILL signal.

--let $allow_rpl_inited=1
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $restart_parameters=restart:--group-replication-group-name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_single_primary_mode=1 --group_replication_enforce_update_everywhere_checks=0
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS
--let $shutdown_server_timeout = 18000
--source include/restart_mysqld.inc

--let $rpl_server_number= 2
--source include/rpl_reconnect.inc

--echo
--echo # 6. Cleanup

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

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

--source include/group_replication_end.inc