Debian Codegraph @

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

raw
1 ################################################################################
2 # This test resolves Deadlock. GR deadlocks when START GR and
3 # UNINSTALL happens at same time.
4 #
5 # Test:
6 # 0. The test requires one server.
7 # 1. Setup GR environment and execute START GR.
8 # 2. Block start, so we can execute UNINSTALL.
9 # 3. Execute UNINSTALL PLUGIN GR.
10 # 4. SIGNAL START GR to resume processing.
11 # 5. Confirm plugin is UNINSTALLED
12 # 6. Cleanup
13 #
14 ################################################################################
15 --source include/have_debug.inc
16 --source include/have_group_replication_plugin.inc
17 --let $rpl_skip_group_replication_start= 1
18 --source include/group_replication.inc
19
20 --echo
21 --echo # 1. Setup GR environment and execute START GR.
22 --echo
23
24 --let $rpl_connection_name= server1
25 --source include/rpl_connection.inc
26
27 SET GLOBAL group_replication_bootstrap_group=ON;
28 SET GLOBAL group_replication_group_name = '8a94f357-bbbb-22aa-33bb-cccaaa420000';
29
30 --echo
31 --echo # 2. Block start, so we can execute UNINSTALL.
32 --echo
33
34 ## If START GR gets lock and UNINSTALL blocks SQL Query execution,
35 ## GR used to deadlock.
36
37 SET @debug_save= @@GLOBAL.DEBUG;
38 SET @@GLOBAL.DEBUG= 'd,group_replication_wait_on_start';
39
40 --send START GROUP_REPLICATION
41
42 --echo
43 --echo # 3. Execute UNINSTALL PLUGIN GR from second connection.
44 --echo
45 --let $rpl_connection_name= server_1
46 --source include/rpl_connection.inc
47 # Wait for the debug sync to be reached.
48 SET DEBUG_SYNC= "now WAIT_FOR signal.start_waiting";
49
50 UNINSTALL PLUGIN group_replication;
51
52 --echo Wait for group replication plugin to be deleted.
53 --let $wait_condition= SELECT COUNT(*)=1 from information_schema.plugins where PLUGIN_NAME like 'group_replication' and PLUGIN_STATUS like 'DELETED';
54 --source include/wait_condition.inc
55
56 --echo
57 --echo # 4. SIGNAL START GR to resume processing.
58 --echo
59 SET DEBUG_SYNC= 'now SIGNAL signal.start_continue';
60
61 --let $rpl_connection_name= server1
62 --source include/rpl_connection.inc
63 --reap
64
65 --echo
66 --echo # 5. Confirm plugin is UNINSTALLED.
67 --echo
68
69 --echo Wait for group replication plugin to be removed.
70 --let $wait_condition= SELECT COUNT(*)=0 from information_schema.plugins where PLUGIN_NAME like 'group_replication';
71 --source include/wait_condition.inc
72
73 --echo
74 --echo # 6. Cleanup
75 --echo
76
77 #Some test executions may uninstall the plugin before the member is ONLINE and writable
78 SET GLOBAL read_only = 0;
79
80 --source include/install_group_replication_plugin.inc
81
82 SET @@GLOBAL.DEBUG= @debug_save;
83 --source include/group_replication_end.inc