config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/group_replication/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_readmode_on_autostart.test

################################################################################
# This test proves that the plugin will leave the group when it cannot enable
# the read mode in the server.
#
# Test:
#  0) The test requires two servers.
#  1) Bootstrap group with server 1.
#  2) Restart server 2 with start_on_boot=1 (to enable it for the install).
#  3) Insert some data on server 1.
#  4) Uninstall and Install the plugin on member 2 (auto start enabled on 2)
#     Use a debug point to make the read mode fail when connecting.
#  5) Verify that server 2 goes to ERROR state. Check that we cannot execute
#     transactions.
#  6) Check all is fine after restarting group replication on server 2.
#  7) Clean up.
################################################################################

--source include/big_test.inc
--source include/have_debug.inc
--let $group_replication_group_name= 7768a190-a421-11e5-a837-0800200c9a66
--source ../inc/have_group_replication_plugin.inc
--source include/force_restart.inc
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc

--echo #
--echo # Bootstrap group with server 1.
--echo #

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source ../inc/start_and_bootstrap_group_replication.inc

--echo #
--echo # Restart group replication on server 2
--echo # with group_replication_start_on_boot=1
--echo #

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

set session sql_log_bin=0;
call mtr.add_suppression("Error when activating super_read_only mode on start. The member will now exit the group.");
call mtr.add_suppression("Transaction cannot be executed while Group Replication is on ERROR state.*");
call mtr.add_suppression("Run function 'before_commit' in plugin 'group_replication' failed*");
call mtr.add_suppression("The member is leaving a group without being on one");
call mtr.add_suppression("The group replication user is not present in the server. The user will be recreated, please do not remove it");
call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going.");
call mtr.add_suppression("On plugin shutdown it was not possible to enable the server read only mode.*");
set session sql_log_bin=1;

SET @debug_save= @@GLOBAL.DEBUG;

--let $allow_rpl_inited= 1
--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_group_whitelist= `SELECT @@GLOBAL.group_replication_ip_whitelist`
--let $restart_parameters=restart:--group_replication_local_address=$_group_replication_local_address --group_replication_group_seeds=$_group_replication_group_seeds --group_replication_start_on_boot=1 --group_replication_ip_whitelist=$_group_replication_group_whitelist
--replace_result $_group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $_group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $_group_replication_group_whitelist GROUP_REPLICATION_GROUP_WHITELIST
--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
--let $group_replication_member_state= ONLINE
--source ../inc/gr_wait_for_member_state.inc

--echo #
--echo # Add some data to server 1.
--echo #

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

-- source include/rpl_sync.inc

--echo #
--echo # On server 2 uninstall and install the plugin with auto start.
--echo # With debug set to group_replication_read_mode_error it should fail.
--echo #

--let $rpl_connection_name= server2
--source include/rpl_connection.inc

UNINSTALL PLUGIN group_replication;

SET @@GLOBAL.DEBUG='d,group_replication_read_mode_error';

--replace_result $GROUP_REPLICATION GROUP_REPLICATION
--eval INSTALL PLUGIN group_replication SONAME '$GROUP_REPLICATION'

 --let $group_replication_member_state= ERROR
 --source ../inc/gr_wait_for_member_state.inc

--echo #
--echo # Check that we cannot execute transactions
--echo #

--error ER_RUN_HOOK_ERROR
INSERT INTO t1 VALUES (2);

--let $skip_assert_read_only= 1
--source include/stop_group_replication.inc

--echo #
--echo # On server 2 after restarting GR all should be fine.
--echo #

SET @@GLOBAL.DEBUG= @debug_save;
--source include/start_group_replication.inc

INSERT INTO t1 VALUES (2);

--let $rpl_connection_name= server1
--source include/rpl_connection.inc

# The data should be there.
--let $wait_condition= SELECT COUNT(*) = 2 FROM t1;
--source include/wait_condition.inc

--echo #
--echo # Clean up
--echo #

DROP TABLE t1;

--source ../inc/group_replication_end.inc

Man Man