Debian Codegraph @

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

raw
1 ################################################################################
2 # Verify that entries corresponding to the GCS performance schema instrumented
3 # mutexes and conds are in the setup_instruments table during the period the
4 # group replication plugin is installed, and that the corresponding entries are
5 # in the mutex_instances and cond_instances tables only during the execution of
6 # the plugin.
7 #
8 # Test:
9 # 0. The test requires one Server: M1
10 # 1. Verify that no entries corresponding to the instrumented GCS mutexes and
11 # conds are in the mutex_instances, cond_instances,
12 # events_waits_current and events_waits_history tables.
13 # 2. Start GR on M1.
14 # 3. Verify that the entries corresponding to the instrumented GCS mutexes and
15 # conds are in the setup_instruments, mutex_instances, cond_instances,
16 # events_waits_current and events_waits_history tables.
17 # 4. Stop GR on M1.
18 # 5. Verify that the entries corresponding to the instrumented GCS mutexes and
19 # conds remain in the setup_instruments table, and that no instances related
20 # entries remain in the mutex_instances, cond_instances,
21 # events_waits_current and events_waits_history tables.
22 # 6. Test end.
23 ################################################################################
24
25 --source include/have_group_replication_plugin.inc
26 --let $rpl_skip_group_replication_start= 1
27 --source include/group_replication.inc
28
29 --echo
30 --echo ############################################################
31 --echo # 1. Verify that no entries corresponding to the
32 --echo # instrumented GCS mutexes and conds are in the
33 --echo # setup_instruments table, as well as no corresponding
34 --echo # instances are in the mutex_instances or cond_instances
35 --echo # tables immediately after plugin installation (before
36 --echo # starting the GR).
37 --connection server1
38
39 --let $assert_text= 'There should be no GCS instrumented mutex entries in the mutex_instances table before starting the GR'
40 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
41 --source include/assert.inc
42
43 --let $assert_text= 'There should be no GCS instrumented cond entries in the cond_instances table before starting the GR'
44 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.cond_instances WHERE NAME LIKE "%_COND_GCS_%"
45 --source include/assert.inc
46
47
48 --echo
49 --echo ############################################################
50 --echo # 2. Start the GR
51 --source include/start_and_bootstrap_group_replication.inc
52
53 --echo
54 --echo ############################################################
55 --echo # 3. Verify that the entries corresponding to the
56 --echo # instrumented GCS mutexes and conds are in the
57 --echo # setup_instruments table, and that the corresponding
58 --echo # instances are in the mutex_instances and
59 --echo # cond_instances tables after starting the GR.
60
61 --let $assert_text= 'There should be 21 GCS instrumented mutex and cond entries in the setup_instruments table after starting the GR'
62 --let $assert_cond= COUNT(*) = 21 FROM performance_schema.setup_instruments WHERE (NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" OR NAME LIKE "wait/synch/cond/group_rpl/GCS_%")
63 --source include/assert.inc
64 SELECT * FROM performance_schema.setup_instruments WHERE (NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" OR NAME LIKE "wait/synch/cond/group_rpl/GCS_%") ORDER BY NAME;
65
66
67 --let $assert_text= 'There should be 9 GCS instrumented cond entries in the cond_instances table after starting the GR'
68 --let $assert_cond= COUNT(*) = 9 FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%"
69 --source include/assert.inc
70 SELECT NAME FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%" ORDER BY NAME;
71
72
73 --let $assert_text= 'There should be 12 GCS instrumented mutex entries in the mutex_instances table after starting the GR'
74 --let $assert_cond= COUNT(*) = 12 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
75 --source include/assert.inc
76 SELECT NAME FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" ORDER BY NAME;
77
78
79
80 --echo
81 --echo ############################################################
82 --echo # 4. Stop the GR
83 --source include/stop_group_replication.inc
84
85
86 --echo
87 --echo ############################################################
88 --echo # 5. Verify that the entries corresponding to the
89 --echo # instrumented GCS mutexes and conds remain in the
90 --echo # setup_instruments table, and that no corresponding
91 --echo # instances remain in the mutex_instances and
92 --echo # cond_instances tables after stopping the GR.
93
94 --let $assert_text= 'There should be the same 21 GCS instrumented mutex and cond entries in the setup_instruments table after stopping the GR'
95 --let $assert_cond= COUNT(*) = 21 FROM performance_schema.setup_instruments WHERE (NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" OR NAME LIKE "wait/synch/cond/group_rpl/GCS_%")
96 --source include/assert.inc
97 SELECT * FROM performance_schema.setup_instruments WHERE (NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" OR NAME LIKE "wait/synch/cond/group_rpl/GCS_%") ORDER BY NAME;
98
99 --let $assert_text= 'There should be no GCS instrumented mutex entries in the mutex_instances table after stopping the GR'
100 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
101 --source include/assert.inc
102
103 --let $assert_text= 'There should be no GCS instrumented cond entries in the cond_instances table after stopping the GR'
104 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%"
105 --source include/assert.inc
106
107
108
109
110 --echo
111 --echo ############################################################
112 --echo # 6. Test end.
113 --source include/group_replication_end.inc