| 1 |
############################################################################### |
| 2 |
# Validate that when a 8.0.27+ server joins a 8.0.26 group, the joining server |
| 3 |
# preserves its default "mysql_start_failover_channels_if_primary" member action. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires two servers: M1 and M2. |
| 7 |
# 1. Bootstrap a group with server1 as the primary, faking |
| 8 |
# that this server has 8.0.26 version. |
| 9 |
# 2. Join server2 to the group. |
| 10 |
# server2 must have the member action |
| 11 |
# "mysql_start_failover_channels_if_primary" before and |
| 12 |
# after join the group. |
| 13 |
# 3. Clean up. |
| 14 |
############################################################################### |
| 15 |
--let $rpl_group_replication_single_primary_mode=1 |
| 16 |
--let $rpl_skip_group_replication_start= 1 |
| 17 |
--source include/have_group_replication_plugin.inc |
| 18 |
--source include/group_replication.inc |
| 19 |
|
| 20 |
--echo |
| 21 |
--echo ############################################################ |
| 22 |
--echo # 1. Bootstrap a group with server1 as the primary, faking |
| 23 |
--echo # that this server has 8.0.26 version. |
| 24 |
--let $rpl_connection_name= server1 |
| 25 |
--source include/rpl_connection.inc |
| 26 |
|
| 27 |
# Fake that this is a 8.0.26 server by deleting the member action |
| 28 |
# "mysql_start_failover_channels_if_primary". |
| 29 |
SET session sql_log_bin=0; |
| 30 |
DELETE FROM mysql.replication_group_member_actions WHERE name="mysql_start_failover_channels_if_primary"; |
| 31 |
SET session sql_log_bin=1; |
| 32 |
|
| 33 |
--source include/start_and_bootstrap_group_replication.inc |
| 34 |
|
| 35 |
--let $assert_text= There must be one member action |
| 36 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions] = 1 |
| 37 |
--source include/assert.inc |
| 38 |
|
| 39 |
--let $assert_text= mysql_disable_super_read_only_if_primary action default value |
| 40 |
--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 |
| 41 |
--source include/assert.inc |
| 42 |
|
| 43 |
--let $assert_text= There must be one GR configuration version |
| 44 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_configuration_version] = 1 |
| 45 |
--source include/assert.inc |
| 46 |
|
| 47 |
--let $assert_text= The version of replication_group_member_actions must be 1 |
| 48 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1 |
| 49 |
--source include/assert.inc |
| 50 |
|
| 51 |
|
| 52 |
--echo |
| 53 |
--echo ############################################################ |
| 54 |
--echo # 2. Join server2 to the group. |
| 55 |
--echo # server2 must have the member action |
| 56 |
--echo # "mysql_start_failover_channels_if_primary" before and |
| 57 |
--echo # after join the group. |
| 58 |
--let $rpl_connection_name= server2 |
| 59 |
--source include/rpl_connection.inc |
| 60 |
|
| 61 |
--let $assert_text= There must be two member actions |
| 62 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions] = 2 |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
--let $assert_text= mysql_disable_super_read_only_if_primary action default value |
| 66 |
--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 |
| 67 |
--source include/assert.inc |
| 68 |
|
| 69 |
--let $assert_text= mysql_start_failover_channels_if_primary action default value |
| 70 |
--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 |
| 71 |
--source include/assert.inc |
| 72 |
|
| 73 |
--let $assert_text= There must be one GR configuration version |
| 74 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_configuration_version] = 1 |
| 75 |
--source include/assert.inc |
| 76 |
|
| 77 |
--let $assert_text= The version of replication_group_member_actions must be 1 |
| 78 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1 |
| 79 |
--source include/assert.inc |
| 80 |
|
| 81 |
--source include/start_group_replication.inc |
| 82 |
|
| 83 |
--let $assert_text= There must be two member actions |
| 84 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_member_actions] = 2 |
| 85 |
--source include/assert.inc |
| 86 |
|
| 87 |
--let $assert_text= mysql_disable_super_read_only_if_primary action default value |
| 88 |
--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 |
| 89 |
--source include/assert.inc |
| 90 |
|
| 91 |
--let $assert_text= mysql_start_failover_channels_if_primary action default value |
| 92 |
--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 |
| 93 |
--source include/assert.inc |
| 94 |
|
| 95 |
--let $assert_text= There must be one GR configuration version |
| 96 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_group_configuration_version] = 1 |
| 97 |
--source include/assert.inc |
| 98 |
|
| 99 |
--let $assert_text= The version of replication_group_member_actions must be 1 |
| 100 |
--let $assert_cond= [SELECT version FROM performance_schema.replication_group_configuration_version WHERE name=\'replication_group_member_actions\', version, 1] = 1 |
| 101 |
--source include/assert.inc |
| 102 |
|
| 103 |
|
| 104 |
--echo |
| 105 |
--echo ############################################################ |
| 106 |
--echo # 3. Clean up. |
| 107 |
--source include/group_replication_end.inc |