File: gr_gcs_psi_mutex_cond.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (113 lines) | stat: -rw-r--r-- 5,919 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
################################################################################
# Verify that entries corresponding to the GCS performance schema instrumented
# mutexes and conds are in the setup_instruments table during the period the
# group replication plugin is installed, and that the corresponding entries are
# in the mutex_instances and cond_instances tables only during the execution of
# the plugin.
#
# Test:
# 0. The test requires one Server: M1
# 1. Verify that no entries corresponding to the instrumented GCS mutexes and
#    conds are in the mutex_instances, cond_instances,
#    events_waits_current and events_waits_history tables.
# 2. Start GR on M1.
# 3. Verify that the entries corresponding to the instrumented GCS mutexes and
#    conds are in the setup_instruments, mutex_instances, cond_instances,
#    events_waits_current and events_waits_history tables.
# 4. Stop GR on M1.
# 5. Verify that the entries corresponding to the instrumented GCS mutexes and
#    conds remain in the setup_instruments table, and that no instances related
#    entries remain in the mutex_instances, cond_instances,
#    events_waits_current and events_waits_history tables.
# 6. Test end.
################################################################################

--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc

--echo
--echo ############################################################
--echo # 1. Verify that no entries corresponding to the
--echo #    instrumented GCS mutexes and conds are in the
--echo #    setup_instruments table, as well as no corresponding
--echo #    instances are in the mutex_instances or cond_instances
--echo #    tables immediately after plugin installation (before
--echo #    starting the GR).
--connection server1

--let $assert_text= 'There should be no GCS instrumented mutex entries in the mutex_instances table before starting the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
--source include/assert.inc

--let $assert_text= 'There should be no GCS instrumented cond entries in the cond_instances table before starting the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.cond_instances WHERE NAME LIKE "%_COND_GCS_%"
--source include/assert.inc


--echo
--echo ############################################################
--echo # 2. Start the GR
--source include/start_and_bootstrap_group_replication.inc

--echo
--echo ############################################################
--echo # 3. Verify that the entries corresponding to the
--echo #    instrumented GCS mutexes and conds are in the
--echo #    setup_instruments table, and that the corresponding
--echo #    instances are in the mutex_instances and
--echo #    cond_instances tables after starting the GR.

--let $assert_text= 'There should be 21 GCS instrumented mutex and cond entries in the setup_instruments table after starting the GR'
--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_%")
--source include/assert.inc
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;


--let $assert_text= 'There should be 9 GCS instrumented cond entries in the cond_instances table after starting the GR'
--let $assert_cond= COUNT(*) = 9 FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%"
--source include/assert.inc
SELECT NAME FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%" ORDER BY NAME;


--let $assert_text= 'There should be 12 GCS instrumented mutex entries in the mutex_instances table after starting the GR'
--let $assert_cond= COUNT(*) = 12 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
--source include/assert.inc
SELECT NAME FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%" ORDER BY NAME;



--echo
--echo ############################################################
--echo # 4. Stop the GR
--source include/stop_group_replication.inc


--echo
--echo ############################################################
--echo # 5. Verify that the entries corresponding to the
--echo #    instrumented GCS mutexes and conds remain in the
--echo #    setup_instruments table, and that no corresponding
--echo #    instances remain in the mutex_instances and
--echo #    cond_instances tables after stopping the GR.

--let $assert_text= 'There should be the same 21 GCS instrumented mutex and cond entries in the setup_instruments table after stopping the GR'
--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_%")
--source include/assert.inc
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;

--let $assert_text= 'There should be no GCS instrumented mutex entries in the mutex_instances table after stopping the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.mutex_instances WHERE NAME LIKE "wait/synch/mutex/group_rpl/GCS_%"
--source include/assert.inc

--let $assert_text= 'There should be no GCS instrumented cond entries in the cond_instances table after stopping the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.cond_instances WHERE NAME LIKE "wait/synch/cond/group_rpl/GCS_%"
--source include/assert.inc




--echo
--echo ############################################################
--echo # 6. Test end.
--source include/group_replication_end.inc