| 1 |
################################################################################ |
| 2 |
# This test verifies that Warning is thrown/logged when |
| 3 |
# group_replication_ip_whitelist variable is used. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires one server. |
| 7 |
# 1. Try setting group_replication_ip_whitelist variable to AUTOMATIC |
| 8 |
# 2. Try setting group_replication_ip_whitelist variable. |
| 9 |
# 3. Reboot server setting group_replication_ip_whitelist variable. |
| 10 |
# 4. Cleanup. |
| 11 |
################################################################################ |
| 12 |
--source include/have_debug.inc |
| 13 |
--source include/have_group_replication_plugin.inc |
| 14 |
--let $rpl_skip_group_replication_start= 1 |
| 15 |
--source include/group_replication.inc |
| 16 |
|
| 17 |
--let $saved_gr_ip_whitelist = `SELECT @@GLOBAL.group_replication_ip_whitelist;` |
| 18 |
--let $_group_replication_ip_whitelist="127.0.0.1/8" |
| 19 |
|
| 20 |
--echo |
| 21 |
--echo # 1. Try setting group_replication_ip_whitelist variable to AUTOMATIC |
| 22 |
|
| 23 |
SET @@GLOBAL.group_replication_ip_whitelist= "AUTOMATIC"; |
| 24 |
|
| 25 |
--echo |
| 26 |
--echo # 2. Try setting group_replication_ip_whitelist variable. |
| 27 |
|
| 28 |
--eval SET @@GLOBAL.group_replication_ip_whitelist = $_group_replication_ip_whitelist; |
| 29 |
|
| 30 |
# Error is thrown in client since group_replication_ip_whitelist |
| 31 |
# has been used. |
| 32 |
--source include/start_and_bootstrap_group_replication.inc |
| 33 |
|
| 34 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 35 |
--let $assert_only_after= CURRENT_TEST: group_replication.gr_ip_whitelist_deprecation |
| 36 |
--let $assert_select= The syntax 'group_replication_ip_whitelist' is deprecated and will be removed in a future release. Please use group_replication_ip_allowlist instead. |
| 37 |
--let $assert_count= 0 |
| 38 |
--let $assert_text= Deprecation warning is not logged when shown in client. |
| 39 |
--source include/assert_grep.inc |
| 40 |
|
| 41 |
|
| 42 |
--echo |
| 43 |
--echo # 3. Reboot server setting group_replication_ip_whitelist variable. |
| 44 |
--let $allow_rpl_inited=1 |
| 45 |
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 46 |
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` |
| 47 |
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 --group_replication_start_on_boot=1 --group_replication_ip_whitelist=$_group_replication_ip_whitelist |
| 48 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS |
| 49 |
--source include/restart_mysqld.inc |
| 50 |
|
| 51 |
--let $rpl_server_number= 1 |
| 52 |
--source include/rpl_reconnect.inc |
| 53 |
--let $group_replication_member_state= ONLINE |
| 54 |
--source include/gr_wait_for_member_state.inc |
| 55 |
|
| 56 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 57 |
--let $assert_only_after= CURRENT_TEST: group_replication.gr_ip_whitelist_deprecation |
| 58 |
--let $assert_select= The syntax 'group_replication_ip_whitelist' is deprecated and will be removed in a future release. Please use group_replication_ip_allowlist instead. |
| 59 |
--let $assert_count= 1 |
| 60 |
--let $assert_text= Deprecation warning is logged when not shown in client. |
| 61 |
--source include/assert_grep.inc |
| 62 |
|
| 63 |
|
| 64 |
--echo |
| 65 |
--echo # 4. Cleanup. |
| 66 |
|
| 67 |
--source include/stop_group_replication.inc |
| 68 |
SET SESSION sql_log_bin = 0; |
| 69 |
call mtr.add_suppression("\\[GCS\\] Automatically adding IPv. localhost address to the allowlist. It is mandatory that it is added."); |
| 70 |
SET SESSION sql_log_bin = 1; |
| 71 |
|
| 72 |
--replace_result $saved_gr_ip_whitelist GROUP_REPLICATION_IP_WHITELIST |
| 73 |
--eval SET @@GLOBAL.group_replication_ip_whitelist= $saved_gr_ip_whitelist |
| 74 |
|
| 75 |
--let $allow_rpl_inited=1 |
| 76 |
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 77 |
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` |
| 78 |
--let $restart_parameters=restart:--group_replication_group_name=$group_replication_group_name --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_bootstrap_group=1 |
| 79 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS |
| 80 |
--source include/restart_mysqld.inc |
| 81 |
--let $rpl_server_number= 1 |
| 82 |
--source include/rpl_reconnect.inc |
| 83 |
--source include/group_replication_end.inc |