Debian Codegraph @

mysql-test/suite/group_replication/t/gr_set_option_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 set the plugin options that do require exclusive access
13 # to plugin internal state, those set operations will be
14 # disallowed.
15 # 3. Unblock the start procedure, the server will change to
16 # ONLINE state.
17 # 4. Clean up.
18 ################################################################################
19
20 --source include/have_debug_sync.inc
21 --source include/have_group_replication_plugin.inc
22 --source include/force_restart.inc
23 --let $rpl_skip_group_replication_start= 1
24 --source include/group_replication.inc
25
26 --echo
27 --echo ############################################################
28 --echo # 1. Restart server1 with --group_replication_bootstrap_group=1,
29 --echo # while setting a debug sync point just before bootstrap the
30 --echo # group. This will mimic a start timeout due to all seeds be
31 --echo # unreachable.
32 --let $rpl_connection_name= server1
33 --source include/rpl_connection.inc
34
35 SET @@GLOBAL.DEBUG= @debug_save;
36 --let $allow_rpl_inited= 1
37 --let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
38 --let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
39 --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"
40 --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
41 --source include/restart_mysqld.inc
42
43 # Needed as we are not using rpl_restart_server.inc
44 --let $rpl_server_number= 1
45 --source include/rpl_reconnect.inc
46
47
48 --echo
49 --echo ############################################################
50 --echo # 2. While the start procedure is blocked on the sync point,
51 --echo # do set the plugin options that do require exclusive access
52 --echo # to plugin internal state, those set operations will be
53 --echo # disallowed.
54 --let $assert_text= The super_read_only mode must be 1
55 --let $assert_cond= "[SELECT @@GLOBAL.super_read_only]" = 1;
56 --source include/assert.inc
57
58 --let $assert_text= The delayed initialization thread is running after boot
59 --let $assert_cond= "[SELECT COUNT(*) FROM performance_schema.threads WHERE NAME = \"thread/group_rpl/THD_delayed_initialization\"]" = 1;
60 --source include/assert.inc
61
62 --error ER_UNABLE_TO_SET_OPTION
63 SET GLOBAL group_replication_recovery_get_public_key= ON;
64
65 --error ER_UNABLE_TO_SET_OPTION
66 SET GLOBAL group_replication_recovery_use_ssl= ON;
67
68 --error ER_UNABLE_TO_SET_OPTION
69 SET GLOBAL group_replication_recovery_ssl_verify_server_cert= ON;
70
71 --error ER_UNABLE_TO_SET_OPTION
72 SET GLOBAL group_replication_recovery_complete_at= "transactions_applied";
73
74 --error ER_UNABLE_TO_SET_OPTION
75 SET GLOBAL group_replication_group_name= "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab";
76
77 --error ER_UNABLE_TO_SET_OPTION
78 SET GLOBAL group_replication_recovery_retry_count= 1;
79
80 --error ER_UNABLE_TO_SET_OPTION
81 SET GLOBAL group_replication_recovery_reconnect_interval= 1;
82
83 --error ER_UNABLE_TO_SET_OPTION
84 SET GLOBAL group_replication_unreachable_majority_timeout= 1;
85
86 --error ER_UNABLE_TO_SET_OPTION
87 SET GLOBAL group_replication_components_stop_timeout= 2;
88
89 --error ER_UNABLE_TO_SET_OPTION
90 SET GLOBAL group_replication_member_weight= 1;
91
92
93 --echo
94 --echo ############################################################
95 --echo # 3. Unblock the start procedure, the server will change to
96 --echo # ONLINE state.
97 SET DEBUG_SYNC= "now SIGNAL signal.continue_group_join";
98
99 --let $group_replication_member_state= ONLINE
100 --source include/gr_wait_for_member_state.inc
101
102
103 --echo
104 --echo ############################################################
105 --echo # 4. Clean up.
106 SET @@GLOBAL.DEBUG= @debug_save;
107
108 --source include/group_replication_end.inc