Debian Codegraph @

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

raw
1 ################################################################################
2 # Test to validate that setting plugin options during Group
3 # Replication start do not block the start procedure.
4 #
5 # Test:
6 # 0. The test requires one server: M1.
7 # 1. Restart server1 with --group_replication_bootstrap_group=1,
8 # while setting a debug sync point just before bootstrap the
9 # group. This will mimic a start timeout due to all seeds be
10 # unreachable.
11 # 2. While the start procedure is blocked on the sync point,
12 # do execute START GROUP_REPLICATION, it will fail.
13 # 3. Unblock the start procedure, the server start will proceed
14 # and then the START GROUP_REPLICATION will fail.
15 # 4. Clean up.
16 ################################################################################
17
18 --source include/have_debug_sync.inc
19 --source include/have_group_replication_plugin.inc
20 --source include/force_restart.inc
21 --let $rpl_skip_group_replication_start= 1
22 --source include/group_replication.inc
23
24 --echo
25 --echo ############################################################
26 --echo # 1. Restart server1 with --group_replication_bootstrap_group=1,
27 --echo # while setting a debug sync point just before bootstrap the
28 --echo # group. This will mimic a start timeout due to all seeds be
29 --echo # unreachable.
30 --let $rpl_connection_name= server1
31 --source include/rpl_connection.inc
32
33 SET @@GLOBAL.DEBUG= @debug_save;
34 --let $allow_rpl_inited= 1
35 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
36 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
37 --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_bootstrap_group=1 --group_replication_start_on_boot=1 --loose-debug="+d,group_replication_before_joining_the_group"
38 --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
39 --source include/restart_mysqld.inc
40
41 # Needed as we are not using rpl_restart_server.inc
42 --let $rpl_server_number= 1
43 --source include/rpl_reconnect.inc
44
45
46 --echo
47 --echo ############################################################
48 --echo # 2. While the start procedure is blocked on the sync point,
49 --echo # do execute START GROUP_REPLICATION, it will fail.
50 --let $assert_text= The super_read_only mode must be 1
51 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 1;
52 --source include/assert.inc
53
54 --let $assert_text= The delayed initialization thread is running after boot
55 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.threads WHERE NAME = \"thread/group_rpl/THD_delayed_initialization\"]" = 1;
56 --source include/assert.inc
57
58 --let $rpl_connection_name= server_1
59 --source include/rpl_connection.inc
60 --send START GROUP_REPLICATION
61
62
63 --echo
64 --echo ############################################################
65 --echo # 3. Unblock the start procedure, the server start will proceed
66 --echo # and then the START GROUP_REPLICATION will fail.
67 --let $rpl_connection_name= server1
68 --source include/rpl_connection.inc
69 --let $wait_condition= SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE='starting' AND INFO='start group_replication';
70 --source include/wait_condition.inc
71
72 SET DEBUG_SYNC= "now SIGNAL signal.continue_group_join";
73
74 --let $group_replication_member_state= ONLINE
75 --source include/gr_wait_for_member_state.inc
76
77 --let $rpl_connection_name= server_1
78 --source include/rpl_connection.inc
79 --error ER_GROUP_REPLICATION_RUNNING
80 --reap
81
82 --let $assert_text= The super_read_only mode must be 0
83 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 0;
84 --source include/assert.inc
85
86
87 --echo
88 --echo ############################################################
89 --echo # 4. Clean up.
90 --let $rpl_connection_name= server1
91 --source include/rpl_connection.inc
92 SET @@GLOBAL.DEBUG= @debug_save;
93
94 --source include/group_replication_end.inc