Debian Codegraph @

mysql-test/suite/group_replication/include/gr_gcs_psi_threads.inc

raw
1 ################################################################################
2 # Verify that entries corresponding to the GCS performance schema instrumented
3 # threads are in the threads table only during the execution of the
4 # group replication plugin.
5 #
6 # Test:
7 # 0. The test requires one Server: M1
8 # 1. Verify that no entries corresponding to the instrumented GCS threads are
9 # in the threads table.
10 # 2. Start GR on M1.
11 # 3. Verify that the entries corresponding to the instrumented GCS threads are
12 # in the threads table.
13 # 4. Stop GR on M1.
14 # 5. Verify that no entries corresponding to the instrumented GCS threads
15 # remain in the threads table.
16 # 6. Test end.
17 ################################################################################
18
19 --source include/have_group_replication_plugin.inc
20 --let $rpl_skip_group_replication_start= 1
21 --source include/group_replication.inc
22
23 --echo
24 --echo ############################################################
25 --echo # 1. Verify that the entries corresponding to the
26 --echo # instrumented GCS threads are not in the threads
27 --echo # table immediately after plugin installation
28 --echo # (before starting the GR).
29 --connection server1
30 --sorted_result
31 SELECT * FROM performance_schema.threads WHERE NAME LIKE '%THD_Gcs_%';
32 --let $assert_text= 'There should be no GCS instrumented threads entries in the threads table before starting the GR'
33 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
34 --source include/assert.inc
35
36 --echo
37 --echo ############################################################
38 --echo # 2. Start the GR
39 --source include/start_and_bootstrap_group_replication.inc
40
41 let $have_xcom_stack= `SELECT @@group_replication_communication_stack LIKE 'XCOM'`;
42 --let $rpl_gcs_number_of_threads=
43 if ($have_xcom_stack)
44 {
45 --let $rpl_gcs_number_of_threads= 4
46 }
47 if (!$have_xcom_stack)
48 {
49 --let $rpl_gcs_number_of_threads= 4
50 }
51
52 --echo
53 --echo ############################################################
54 --echo # 3. Verify that the entries corresponding to the
55 --echo # instrumented GCS threads are in the threads table
56 --echo # after starting the GR.
57 --sorted_result
58 --let $assert_text= 'There should be $rpl_gcs_number_of_threads GCS instrumented thread entries in the threads table after starting the GR'
59 --let $assert_cond= COUNT(*) = $rpl_gcs_number_of_threads FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
60 --source include/assert.inc
61
62 --echo
63 --echo ############################################################
64 --echo # 4. Stop the GR
65 --source include/stop_group_replication.inc
66
67 --echo
68 --echo ############################################################
69 --echo # 5. Verify that no entries corresponding to the
70 --echo # instrumented GCS threads remain in the threads table
71 --echo # after stopping the GR.
72 --sorted_result
73 SELECT * FROM performance_schema.threads WHERE NAME LIKE '%THD_Gcs_%';
74 --let $assert_text= 'There should be no extra psi keys added after starting the GR'
75 --let $assert_cond= COUNT(*) = 0 FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
76 --source include/assert.inc
77
78 --echo
79 --echo ############################################################
80 --echo # 6. Test end.
81 --source include/group_replication_end.inc