Debian Codegraph @

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

raw
1 ################################################################################
2 # This test checks that
3 # 1. The delayed thread is only running when the server starts on boot
4 # 2. Connections are possible when the server enters read mode but it is still
5 # connecting
6 # 3. Uninstalling the GR plugin fails while the server is still starting
7 #
8 # To test this:
9 # 0. The test requires one stopped server.
10 # 1. Check that the delayed thread is not running when the without start on boot
11 # 2. Start group replication. Check that the delayed thread is still not there
12 # 3. Restart server with start on boot. Check that
13 # 3.1.The read mode is one when connections are allowed
14 # 3.2.There is a delayed thread running
15 # 3.3 The join is stuck on debug so the member is still OFFLINE.
16 # 4. Read mode is disabled.
17 # 5. Issue request to uninstall GR, which fails.
18 # 6. Read mode is enabled.
19 # 7. Execute a parallel start request. Check it will fail when we unblock
20 # 8. Unblock join. Wait for the member to come ONLINE.
21 # 9. Clean up.
22 ################################################################################
23
24 --source include/big_test.inc
25 --source include/have_debug_sync.inc
26 --source include/have_group_replication_plugin.inc
27 --source include/force_restart.inc
28 --let $rpl_skip_group_replication_start= 1
29 --source include/group_replication.inc
30
31 --let $rpl_connection_name= server_1
32 --source include/rpl_connection.inc
33
34 SET @@GLOBAL.DEBUG= @debug_save;
35
36 --echo #
37 --echo # 1. Check that the delayed thread is not running
38 --echo #
39
40 --let $assert_text= The delayed initialization thread is not running
41 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.threads WHERE NAME = \"thread/group_rpl/THD_delayed_initialization\"]" = 0;
42 --source include/assert.inc
43
44 --echo #
45 --echo # 2. Start group replication. Check the thread is still not there
46 --echo #
47
48 --source include/start_and_bootstrap_group_replication.inc
49
50 --let $assert_text= The delayed initialization thread is not running after start
51 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.threads WHERE NAME = \"thread/group_rpl/THD_delayed_initialization\"]" = 0;
52 --source include/assert.inc
53
54 --echo #
55 --echo # 3. Restart the server with start on boot enabled
56 --echo #
57
58 --let $allow_rpl_inited=1
59 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
60 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
61 --let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_start_on_boot=1 --group-replication-group-name=$group_replication_group_name --group_replication_bootstrap_group=1 --loose-debug="+d,group_replication_before_joining_the_group"
62 --replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
63 --source include/restart_mysqld.inc
64
65 --let $rpl_server_number= 1
66 --source include/rpl_reconnect.inc
67
68 --echo #
69 --echo # 3.1 Check the super read only mode is enabled
70 --echo #
71
72 --let $assert_text= The super_read_only mode should be 1 here.
73 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 1;
74 --source include/assert.inc
75
76 --echo #
77 --echo # 3.2 There is a delayed initialization thread running
78 --echo #
79
80 --let $assert_text= The delayed initialization thread is running after boot
81 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.threads WHERE NAME = \"thread/group_rpl/THD_delayed_initialization\"]" = 1;
82 --source include/assert.inc
83
84 --echo #
85 --echo # 3.3 The member is OFFLINE as the join is stuck
86 --echo #
87
88 --echo # Asserting that the member here is offline.
89 --let $group_replication_member_state= OFFLINE
90 --source include/gr_wait_for_member_state.inc
91
92
93 --echo #
94 --echo # 4. Disable the read mode on the server
95 --echo #
96 SET GLOBAL read_only= 0;
97
98 --echo #
99 --echo # 5. Uninstall GR plugin should fail
100 --echo #
101 --error ER_PLUGIN_CANNOT_BE_UNINSTALLED
102 UNINSTALL PLUGIN group_replication;
103
104 --echo #
105 --echo # 6. Enable the read mode on the server
106 --echo #
107 SET GLOBAL super_read_only= 1;
108
109 --echo #
110 --echo # 7. Execute a parallel start request that will fail after join
111 --echo #
112
113 --let $rpl_connection_name= server_1
114 --source include/rpl_connection.inc
115
116 --send START GROUP_REPLICATION;
117
118 --echo #
119 --echo # 8. Unblock. The above start should fail and the server should go ONLINE
120 --echo #
121
122
123 --let $rpl_connection_name= server1
124 --source include/rpl_connection.inc
125
126 SET DEBUG_SYNC= "now SIGNAL signal.continue_group_join";
127
128 --echo # Wait for the server to be ONLINE
129 --let $group_replication_member_state= ONLINE
130 --source include/gr_wait_for_member_state.inc
131
132 --let $rpl_connection_name= server_1
133 --source include/rpl_connection.inc
134
135 --error ER_GROUP_REPLICATION_RUNNING
136 --reap
137
138 --echo #
139 --echo # Cleanup
140 --echo #
141
142 SET @@GLOBAL.DEBUG= @debug_save;
143
144 --source include/group_replication_end.inc