| 1 |
############################################################################### |
| 2 |
# Validate that UDFs |
| 3 |
# asynchronous_connection_failover_reset |
| 4 |
# asynchronous_connection_failover_add_source |
| 5 |
# asynchronous_connection_failover_delete_source |
| 6 |
# asynchronous_connection_failover_add_managed |
| 7 |
# asynchronous_connection_failover_delete_managed |
| 8 |
# cannot be changed on a Group Replication secondary member. |
| 9 |
# |
| 10 |
# Test: |
| 11 |
# 0. This test requires two servers |
| 12 |
# 1. Try to enable and disable a replication failover configuration |
| 13 |
# on a secondary. |
| 14 |
# It will not be allowed. |
| 15 |
# 2. Check that configuration was not changed. |
| 16 |
# 3. Clean up |
| 17 |
############################################################################### |
| 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 |
--echo ############################################################ |
| 24 |
--echo # 1. Try to enable and disable a replication failover configuration |
| 25 |
--echo # on a secondary. |
| 26 |
--echo # It will not be allowed. |
| 27 |
--let $rpl_connection_name= server1 |
| 28 |
--source include/rpl_connection.inc |
| 29 |
--source include/start_and_bootstrap_group_replication.inc |
| 30 |
|
| 31 |
--let $rpl_connection_name= server2 |
| 32 |
--source include/rpl_connection.inc |
| 33 |
--source include/start_group_replication.inc |
| 34 |
--source include/gr_assert_secondary_member.inc |
| 35 |
|
| 36 |
--error ER_CANT_INITIALIZE_UDF |
| 37 |
SELECT asynchronous_connection_failover_reset(); |
| 38 |
|
| 39 |
--error ER_CANT_INITIALIZE_UDF |
| 40 |
SELECT asynchronous_connection_failover_add_source('ch1', '127.0.0.1', 3306, '', 50); |
| 41 |
|
| 42 |
--error ER_CANT_INITIALIZE_UDF |
| 43 |
SELECT asynchronous_connection_failover_delete_source('ch1', '127.0.0.1', 3306, ''); |
| 44 |
|
| 45 |
--error ER_CANT_INITIALIZE_UDF |
| 46 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa','127.0.0.1', 3306, '', 80, 60); |
| 47 |
|
| 48 |
--error ER_CANT_INITIALIZE_UDF |
| 49 |
SELECT asynchronous_connection_failover_delete_managed('ch1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); |
| 50 |
|
| 51 |
--error ER_OPERATION_NOT_ALLOWED_ON_GR_SECONDARY |
| 52 |
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION=1, SOURCE_CONNECTION_AUTO_FAILOVER=1 FOR CHANNEL 'ch1'; |
| 53 |
|
| 54 |
|
| 55 |
--echo |
| 56 |
--echo ############################################################ |
| 57 |
--echo # 2. Check that configuration was not changed. |
| 58 |
--let $rpl_connection_name= server2 |
| 59 |
--source include/rpl_connection.inc |
| 60 |
|
| 61 |
--let $assert_text= There must be no failover sources |
| 62 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_asynchronous_connection_failover] = 0 |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
--let $assert_text= There must be no failover managed sources |
| 66 |
--let $assert_cond= [SELECT COUNT(*) FROM performance_schema.replication_asynchronous_connection_failover_managed] = 0 |
| 67 |
--source include/assert.inc |
| 68 |
|
| 69 |
--let $assert_text= 'There is no replication channel ch1' |
| 70 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM performance_schema.replication_connection_status where CHANNEL_NAME="ch1", count, 1] = 0 |
| 71 |
--source include/assert.inc |
| 72 |
|
| 73 |
|
| 74 |
--echo |
| 75 |
--echo ############################################################ |
| 76 |
--echo # 3. Clean up. |
| 77 |
--source include/group_replication_end.inc |