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
|
################################################################################
# Verify that entries corresponding to the GCS performance schema instrumented
# threads are in the threads table only during the execution of the
# group replication plugin.
#
# Test:
# 0. The test requires one Server: M1
# 1. Verify that no entries corresponding to the instrumented GCS threads are
# in the threads table.
# 2. Start GR on M1.
# 3. Verify that the entries corresponding to the instrumented GCS threads are
# in the threads table.
# 4. Stop GR on M1.
# 5. Verify that no entries corresponding to the instrumented GCS threads
# remain in the threads table.
# 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 the entries corresponding to the
--echo # instrumented GCS threads are not in the threads
--echo # table immediately after plugin installation
--echo # (before starting the GR).
--connection server1
--sorted_result
SELECT * FROM performance_schema.threads WHERE NAME LIKE '%THD_Gcs_%';
--let $assert_text= 'There should be no GCS instrumented threads entries in the threads table before starting the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
--source include/assert.inc
--echo
--echo ############################################################
--echo # 2. Start the GR
--source include/start_and_bootstrap_group_replication.inc
let $have_xcom_stack= `SELECT @@group_replication_communication_stack LIKE 'XCOM'`;
--let $rpl_gcs_number_of_threads=
if ($have_xcom_stack)
{
--let $rpl_gcs_number_of_threads= 4
}
if (!$have_xcom_stack)
{
--let $rpl_gcs_number_of_threads= 4
}
--echo
--echo ############################################################
--echo # 3. Verify that the entries corresponding to the
--echo # instrumented GCS threads are in the threads table
--echo # after starting the GR.
--sorted_result
--let $assert_text= 'There should be $rpl_gcs_number_of_threads GCS instrumented thread entries in the threads table after starting the GR'
--let $assert_cond= COUNT(*) = $rpl_gcs_number_of_threads FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
--source include/assert.inc
--echo
--echo ############################################################
--echo # 4. Stop the GR
--source include/stop_group_replication.inc
--echo
--echo ############################################################
--echo # 5. Verify that no entries corresponding to the
--echo # instrumented GCS threads remain in the threads table
--echo # after stopping the GR.
--sorted_result
SELECT * FROM performance_schema.threads WHERE NAME LIKE '%THD_Gcs_%';
--let $assert_text= 'There should be no extra psi keys added after starting the GR'
--let $assert_cond= COUNT(*) = 0 FROM performance_schema.threads WHERE NAME LIKE "%THD_Gcs_%"
--source include/assert.inc
--echo
--echo ############################################################
--echo # 6. Test end.
--source include/group_replication_end.inc
|