Debian Codegraph @

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

raw
1 ################################################################################
2 # WL#6842 - GCS APPLIER MODULE
3 #
4 # This test checks the basic functionality of the Group Replication
5 # plugin: the initialization of it's applier module and error cases.
6 #
7 # Test:
8 # 0. The test requires one server.
9 # 1. Expect ER_GROUP_REPLICATION_APPLIER_INIT_ERROR on 'START G.R.' command
10 # due to double occurrence of a singleton applier handler through DEBUG.
11 # 2. Reset DEBUG point. Expect smooth 'START G.R.' command.
12 # 3. Set the stop GR timeout to minimum value 2. Through DEBUG point expect
13 # ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT on 'STOP G.R.' command.
14 # 4. Through DEBUG point expect ER_GROUP_REPLICATION_APPLIER_INIT_ERROR on
15 # 'START G.R.' command because GR is still running.
16 # 5. Signal DEBUG. Sleep for 5 seconds i.e. wait for 'STOP G.R.' to
17 # complete.
18 # 6. Reset DEBUG point. START and STOP G.R. should succeed now.
19 ################################################################################
20
21 --source include/have_debug.inc
22 --let $group_replication_group_name= 2d249320-2e06-11e3-aa6e-0800200c9a66
23 --source include/have_group_replication_plugin.inc
24
25 --let $rpl_skip_group_replication_start= 1
26 --source include/group_replication.inc
27
28 set session sql_log_bin=0;
29 call mtr.add_suppression("A group replication applier handler, marked *.*");
30 call mtr.add_suppression("Cannot start the group replication applier as *.*");
31 call mtr.add_suppression("On shutdown there was a timeout on the group replication applier *.*");
32 call mtr.add_suppression("The member is leaving a group without being on one");
33 set session sql_log_bin=1;
34
35 SET @group_replication_components_stop_timeout_save = @@GLOBAL.group_replication_components_stop_timeout;
36
37 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
38 --source include/gr_set_bootstrap_group.inc
39
40 SET @debug_save= @@GLOBAL.DEBUG;
41 SET GLOBAL debug= 'd,double_unique_handler';
42
43 # This start command will error out due to the double occurrence
44 # of a singleton handler (applier initialization error).
45 --error ER_GROUP_REPLICATION_APPLIER_INIT_ERROR
46 START GROUP_REPLICATION;
47
48 SET @@GLOBAL.DEBUG= @debug_save;
49
50 #The initialization process should now go smoothly
51 --source include/start_group_replication.inc
52
53 #Set the timeout to the minimum value: 2
54 --eval SET GLOBAL group_replication_components_stop_timeout= 2
55
56 --let $assert_text= The value of stop_components_timeout should be 2
57 --let $assert_cond= [SELECT @@group_replication_components_stop_timeout] = 2
58 --source include/assert.inc
59
60 SET @@GLOBAL.DEBUG= 'd,applier_thd_timeout';
61
62 #The applier thread is stuck so the STOP command will timeout
63 --error ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT
64 STOP GROUP_REPLICATION;
65
66 #The start command will fail as the applier is still running
67 --error ER_GROUP_REPLICATION_APPLIER_INIT_ERROR
68 START GROUP_REPLICATION;
69
70 SET DEBUG_SYNC= "now SIGNAL signal.applier_continue";
71 SET @@GLOBAL.DEBUG= @debug_save;
72
73 #give it time to die
74 --sleep 5
75
76 SET GLOBAl group_replication_components_stop_timeout = @group_replication_components_stop_timeout_save;
77 #start and stop commands should work properly
78 --source include/start_group_replication.inc
79 --source include/stop_group_replication.inc
80
81 SET @@GLOBAL.DEBUG= @debug_save;
82 --source include/group_replication_end.inc