| 1 |
############################################################################### |
| 2 |
# Validate the behavior that when a member joins a group on which all members |
| 3 |
# do not support member actions, it does reset its configuration to the default |
| 4 |
# one. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. This test requires two servers |
| 8 |
# 1. Bootstrap a group and increase the member actions |
| 9 |
# configuration version. |
| 10 |
# Simulate a member version lower than 8.0.25 which does |
| 11 |
# not support member actions, thence does not include its |
| 12 |
# configuration on the exchangeable data. |
| 13 |
# 2. This member will not receive the members configuration |
| 14 |
# thence will reset its configuration to the default one. |
| 15 |
# 3. Clean up |
| 16 |
############################################################################### |
| 17 |
--source include/have_debug.inc |
| 18 |
--source include/have_group_replication_plugin.inc |
| 19 |
--let $rpl_skip_group_replication_start= 1 |
| 20 |
--let $rpl_group_replication_single_primary_mode=1 |
| 21 |
--source include/group_replication.inc |
| 22 |
|
| 23 |
--let $rpl_connection_name= server2 |
| 24 |
--source include/rpl_connection.inc |
| 25 |
SET SESSION sql_log_bin = 0; |
| 26 |
call mtr.add_suppression("This member joined a group on which all members do not support member actions, as such it did reset its member configuration to the default one."); |
| 27 |
call mtr.add_suppression("This member joined a group on which all members do not support replication failover channels integration on Group Replication, as such it did reset its replication failover channels configuration to the default one."); |
| 28 |
SET SESSION sql_log_bin = 1; |
| 29 |
|
| 30 |
|
| 31 |
--echo |
| 32 |
--echo ############################################################ |
| 33 |
--echo # 1. Bootstrap a group and increase the member actions |
| 34 |
--echo # configuration version. |
| 35 |
--echo # Simulate a member version lower than 8.0.25 which does |
| 36 |
--echo # not support member actions, thence does not include its |
| 37 |
--echo # configuration on the exchangeable data. |
| 38 |
--let $rpl_connection_name= server1 |
| 39 |
--source include/rpl_connection.inc |
| 40 |
--source include/start_and_bootstrap_group_replication.inc |
| 41 |
|
| 42 |
SELECT group_replication_disable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION"); |
| 43 |
SELECT group_replication_enable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION"); |
| 44 |
|
| 45 |
--let $assert_text= The version of replication_group_member_actions must be 3 |
| 46 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 3 |
| 47 |
--source include/assert.inc |
| 48 |
|
| 49 |
SET @@GLOBAL.DEBUG='+d,group_replication_skip_add_member_actions_to_exchangeable_data'; |
| 50 |
|
| 51 |
|
| 52 |
--echo |
| 53 |
--echo ############################################################ |
| 54 |
--echo # 2. This member will not receive the members configuration |
| 55 |
--echo # thence will reset its configuration to the default one. |
| 56 |
--let $rpl_connection_name= server2 |
| 57 |
--source include/rpl_connection.inc |
| 58 |
|
| 59 |
SELECT group_replication_disable_member_action("mysql_disable_super_read_only_if_primary", "AFTER_PRIMARY_ELECTION"); |
| 60 |
|
| 61 |
--let $assert_text= The action mysql_disable_super_read_only_if_primary must be disabled |
| 62 |
--let $assert_cond= [SELECT enabled FROM performance_schema.replication_group_member_actions WHERE name=\'mysql_disable_super_read_only_if_primary\' AND event=\'AFTER_PRIMARY_ELECTION\', enabled, 1] = 0 |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
--let $assert_text= The version of replication_group_member_actions must be 2 |
| 66 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 2 |
| 67 |
--source include/assert.inc |
| 68 |
|
| 69 |
--source include/start_group_replication.inc |
| 70 |
|
| 71 |
--let $assert_text= There must be two member actions |
| 72 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions] = 2 |
| 73 |
--source include/assert.inc |
| 74 |
|
| 75 |
--let $assert_text= mysql_disable_super_read_only_if_primary action default value |
| 76 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions WHERE name=\'mysql_disable_super_read_only_if_primary\' AND enabled=1 AND type=\'INTERNAL\' AND event=\'AFTER_PRIMARY_ELECTION\' AND priority=1 AND error_handling=\'IGNORE\'] = 1 |
| 77 |
--source include/assert.inc |
| 78 |
|
| 79 |
--let $assert_text= mysql_start_failover_channels_if_primary action default value |
| 80 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions WHERE name=\'mysql_start_failover_channels_if_primary\' AND enabled=1 AND type=\'INTERNAL\' AND event=\'AFTER_PRIMARY_ELECTION\' AND priority=10 AND error_handling=\'CRITICAL\'] = 1 |
| 81 |
--source include/assert.inc |
| 82 |
|
| 83 |
--let $assert_text= There must be one GR configuration version |
| 84 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_configuration_version] = 1 |
| 85 |
--source include/assert.inc |
| 86 |
|
| 87 |
--let $assert_text= The version of replication_group_member_actions must be 1 |
| 88 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1 |
| 89 |
--source include/assert.inc |
| 90 |
|
| 91 |
--let $assert_only_after = CURRENT_TEST: group_replication.gr_member_actions_join_lower_version_group |
| 92 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err |
| 93 |
--let $assert_select= This member joined a group on which all members do not support member actions, as such it did reset its member configuration to the default one. |
| 94 |
--let $assert_count= 1 |
| 95 |
--let $assert_text= This member joined a group on which all members do not support member actions, as such it did reset its member configuration to the default one. |
| 96 |
--source include/assert_grep.inc |
| 97 |
|
| 98 |
|
| 99 |
--echo |
| 100 |
--echo ############################################################ |
| 101 |
--echo # 3. Clean up. |
| 102 |
--let $rpl_connection_name= server1 |
| 103 |
--source include/rpl_connection.inc |
| 104 |
SET @@GLOBAL.DEBUG='-d,group_replication_skip_add_member_actions_to_exchangeable_data'; |
| 105 |
|
| 106 |
--source include/group_replication_end.inc |