| 1 |
################################################################################ |
| 2 |
# This test verifies that parallel execution of |
| 3 |
# SELECT * FROM performance_schema.replication_group_member_stats and |
| 4 |
# Group Replication options change are handled properly by the server. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. The test requires one server: M1 |
| 8 |
# 1. Bootstrap a group on server1. |
| 9 |
# Setup a debug point that will block a future |
| 10 |
# SELECT * FROM performance_schema.replication_group_member_stats |
| 11 |
# after the plugin_running_lock is acquired. |
| 12 |
# 2. Asynchronously execute a query on the table |
| 13 |
# performance_schema.replication_group_member_stats |
| 14 |
# 3. Change a Group Replication option, it must succeed. |
| 15 |
# 4. Resume the query on the table |
| 16 |
# performance_schema.replication_group_member_stats |
| 17 |
# 5. Clean up. |
| 18 |
################################################################################ |
| 19 |
--source include/have_debug.inc |
| 20 |
--source include/have_debug_sync.inc |
| 21 |
--source include/have_group_replication_plugin.inc |
| 22 |
--let $rpl_skip_group_replication_start= 1 |
| 23 |
--source include/group_replication.inc |
| 24 |
|
| 25 |
|
| 26 |
--echo ############################################################ |
| 27 |
--echo # 1. Bootstrap a group on server1. |
| 28 |
--echo # Setup a debug point that will block a future |
| 29 |
--echo # SELECT * FROM performance_schema.replication_group_member_stats |
| 30 |
--echo # after the plugin_running_lock is acquired. |
| 31 |
--let $rpl_connection_name= server1 |
| 32 |
--source include/rpl_connection.inc |
| 33 |
--source include/start_and_bootstrap_group_replication.inc |
| 34 |
SET @@GLOBAL.DEBUG='+d,group_replication_get_group_member_stats_plugin_running_lock_acquired'; |
| 35 |
|
| 36 |
|
| 37 |
--echo ############################################################ |
| 38 |
--echo # 2. Asynchronously execute a query on the table |
| 39 |
--echo # performance_schema.replication_group_member_stats |
| 40 |
--let $rpl_connection_name= server_1 |
| 41 |
--source include/rpl_connection.inc |
| 42 |
--send SELECT CHANNEL_NAME, COUNT_TRANSACTIONS_ROWS_VALIDATING, COUNT_TRANSACTIONS_REMOTE_APPLIED FROM performance_schema.replication_group_member_stats |
| 43 |
|
| 44 |
--let $rpl_connection_name= server1 |
| 45 |
--source include/rpl_connection.inc |
| 46 |
SET DEBUG_SYNC= "now WAIT_FOR signal.reached_get_group_member_stats_plugin_running_lock_acquired"; |
| 47 |
SET @@GLOBAL.DEBUG='-d,group_replication_get_group_member_stats_plugin_running_lock_acquired'; |
| 48 |
|
| 49 |
|
| 50 |
--echo ############################################################ |
| 51 |
--echo # 3. Change a Group Replication option, it must succeed. |
| 52 |
--let $rpl_connection_name= server1 |
| 53 |
--source include/rpl_connection.inc |
| 54 |
SET @group_replication_member_weight_saved= @@GLOBAL.group_replication_member_weight; |
| 55 |
SET @@GLOBAL.group_replication_member_weight= 100; |
| 56 |
|
| 57 |
--let $assert_text= group_replication_member_weight is 100 |
| 58 |
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_member_weight]" = "100" |
| 59 |
--source include/assert.inc |
| 60 |
|
| 61 |
|
| 62 |
--echo ############################################################ |
| 63 |
--echo # 4. Resume the query on the table |
| 64 |
--echo # performance_schema.replication_group_member_stats |
| 65 |
--let $rpl_connection_name= server1 |
| 66 |
--source include/rpl_connection.inc |
| 67 |
SET DEBUG_SYNC= "now SIGNAL signal.resume_get_group_member_stats_plugin_running_lock_acquired"; |
| 68 |
|
| 69 |
--let $rpl_connection_name= server_1 |
| 70 |
--source include/rpl_connection.inc |
| 71 |
--reap |
| 72 |
|
| 73 |
|
| 74 |
--echo ############################################################ |
| 75 |
--echo # 5. Clean up. |
| 76 |
--let $rpl_connection_name= server1 |
| 77 |
--source include/rpl_connection.inc |
| 78 |
SET @@GLOBAL.group_replication_member_weight= @group_replication_member_weight_saved; |
| 79 |
|
| 80 |
SET DEBUG_SYNC= 'RESET'; |
| 81 |
--source include/group_replication_end.inc |