1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
################################################################################
## This test proves that group replication does not start on server when it's
## lower_case_table_names does not match with the group.
##
## Test:
## 0. This test requires 2 members.
## 1. Verify lower_case_table_names cannot be set while server is
## running and start GR on server-1.
## 2. Store variables of server-2 for restart.
## 3. Test GR does not start on server when lower_case_table_names
## does not match.
## 3A. Test GR does not start on boot when lower_case_table_names
## does not match.
## 3B. Test GR does not start with command when lower_case_table_names
## does not match.
## 4. Cleanup.
################################################################################
--source include/big_test.inc
--source include/have_debug_sync.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
--source include/force_restart.inc
--let $allow_rpl_inited=1
--echo
--echo ## 1. Verify lower_case_table_names cannot be set while server is
--echo ## running and start GR on server-1.
--echo
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
## Verify lower_case_table_names cannot be set while server is running.
## This make sures we do not need to test variable changes while GR is running.
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL lower_case_table_names= 1;
--source include/start_and_bootstrap_group_replication.inc
--echo
--echo ## 2. Store variables of server-2 for restart.
--echo
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $_group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address`
--let $_group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds`
--let $_group_replication_comm_stack= `SELECT @@GLOBAL.group_replication_communication_stack`
set session sql_log_bin=0;
call mtr.add_suppression("The member is configured with a lower_case_table_names option value .*");
call mtr.add_suppression("lower_case_table_names was set to 2, .*");
set session sql_log_bin=1;
--echo
--echo ## 3A. Test GR does not start on boot when lower_case_table_names
--echo ## does not match. And verifies only one member is shown in the
--echo ## group as the join failed.
--echo
--let $restart_parameters=restart:--group_replication_start_on_boot=1 --group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_group_name=$group_replication_group_name --group_replication_communication_stack=$_group_replication_comm_stack --lower_case_table_names=2 --loose-debug="+d,group_replication_wait_before_leave_on_error"
--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 $_group_replication_comm_stack GROUP_REPLICATION_COMMUNICATION_STACK
--source include/restart_mysqld.inc
#Needed as we are not using rpl_restart_server.inc
--let $rpl_server_number= 2
--source include/rpl_reconnect.inc
# Wait for the debug sync to be reached.
SET DEBUG_SYNC= "now WAIT_FOR signal.wait_leave_process";
--let $assert_text= 'Assert group has one member'
--let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members]" = 1
--source include/assert.inc
--let $assert_text= 'Assert server-2 is OFFLINE'
--let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members WHERE MEMBER_STATE=\"OFFLINE\"]" = 1
--source include/assert.inc
# now unblock debug sync point
SET DEBUG_SYNC= "now SIGNAL signal.continue_leave_process";
--echo
--echo ## 3B. Test GR does not start with command when lower_case_table_names
--echo ## does not match.
--echo
--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_text = Found the expected error about lower_case_table_names
--let $assert_select = The member is configured with a lower_case_table_names option value
--let $assert_count = 2
--source include/assert_grep.inc
--let $assert_text= 'Assert server-2 is OFFLINE'
--let $assert_cond= "[SELECT COUNT(*) from performance_schema.replication_group_members WHERE MEMBER_STATE=\"OFFLINE\"]" = 1
--source include/assert.inc
--echo
--echo ## 4. Cleanup.
--echo
--source include/group_replication_end.inc
|