File: gr_primary_mode_group_operations_37.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 (127 lines) | stat: -rw-r--r-- 4,267 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
###############################################################################
#
# When the plugin is stopped or leaves in error, while changing
# from single primary mode to multi primary mode, if the member did
# already set the single primary mode flag to false, then update
# everywhere checks shall be true afer stop.
#
# When the plugin is stopped or leaves in error, plugin configurations
# when the configuration change terminates must be valid,
# even if not persisted with SET PERSIST.
#
# Test:
#   0. This test requires three servers
#   1. Server1 start and bootstrap the group
#   2. Start server2
#   3. Start server3 and fake a stopped applier
#   4. Execute action to switch to multi primary
#   5. Server3 will leave group
#   6. Server3 changed to ERROR state
#   7. Check that Single primary mode is false on the stuck member and the
#      update everywhere checks are true
#   8. Reap action executed
#   9. Cleanup
#
###############################################################################

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

--echo
--echo # 1. Server1 start and bootstrap the group

--source include/start_and_bootstrap_group_replication.inc

--echo
--echo # 2. Start server2

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

--echo
--echo # 3. Start server3 and fake a stopped applier

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

set session sql_log_bin=0;
call mtr.add_suppression("A configuration change was killed in this member. The member will now leave the group as its configuration may have diverged.");
call mtr.add_suppression("The server was automatically set into read only mode after an error was detected.");
call mtr.add_suppression("Error while executing a group configuration operation: This operation ended in error as it was not possible to wait for the execution of the plugin queued transactions. The member will now leave the group.");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
set session sql_log_bin=1;

--source include/start_group_replication.inc

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

--echo
--echo # 4. Execute action to switch to multi primary

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

--send SELECT group_replication_switch_to_multi_primary_mode()

--echo
--echo # 5. Server3 will leave group

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

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

--echo
--echo # 6. Server3 changed to ERROR state

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

--let $group_replication_member_state= ERROR
--source include/gr_wait_for_member_state.inc

SET @@GLOBAL.DEBUG= '-d,group_replication_wait_for_gtid_execution_force_error';

--echo
--echo # 7. Check that Single primary mode is false on the stuck member and the
--echo #    update everywhere checks are true

--let $assert_text= group_replication_enforce_update_everywhere_checks is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks]" = "1"
--source include/assert.inc

--let $assert_text= The single primary mode should be 0 here.
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_single_primary_mode]" = 0;
--source include/assert.inc

--echo
--echo # 8. Reap action executed

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

--reap

--echo
--echo # 9. Cleanup

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

--source include/stop_group_replication.inc

--let $group_replication_member_state= OFFLINE
--source include/gr_wait_for_member_state.inc

--source include/start_group_replication.inc

--let $rpl_group_replication_reset_persistent_vars=1
--let $rpl_group_replication_single_primary_mode=1
--source include/group_replication_end.inc