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 |
Current File : //usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_autostart_on_install.test |
################################################################################ # This test validates that no issue exists when a member auto joins an existing # group during installation. # # To test this: # 0) The test requires two servers: M1 and M2. # 1) Bootstrap group replication on member 1. # 2) Restart server 2 with start_on_boot=1 (to enable it for the install) # Stop group replication and reset the applier channel. # 3) Insert some data on server 1 and stop the applier to block recovery on # server 2. # 4) Uninstall and Install the plugin on member 2 (auto start enabled on 2) # 5) Verify that no transaction can be executed while server 2 recovers. # 6) Check all is fine after unblocking recovery. # 7) Clean up. ################################################################################ --let $group_replication_group_name= ce94c230-2fc0-11e5-a2cb-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 # --connection server1 --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 # --connection server2 --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 $_init_server2_auto_increment= `SELECT @@GLOBAL.AUTO_INCREMENT_INCREMENT` --let $_init_server2_auto_offset= `SELECT @@GLOBAL.AUTO_INCREMENT_OFFSET` --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc --source include/stop_group_replication.inc # A RESET MASTER was executed in the context of include/master-slave.inc after # the server auto started group replication. # The server applier logs will be reset to avoid recovery problems. RESET SLAVE ALL FOR CHANNEL "group_replication_applier"; --echo # --echo # Add some data to server 1. --echo # --connection server1 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --source ../inc/gr_stop_applier_sql_thread.inc --echo # --echo # On server 2 uninstall and install the plugin with auto start. --echo # The plugin should start automatically and recover the missing data --echo # --connection server2 UNINSTALL PLUGIN group_replication; --replace_result $GROUP_REPLICATION GROUP_REPLICATION --eval INSTALL PLUGIN group_replication SONAME '$GROUP_REPLICATION' --echo # --echo # On server 2 after restart, recovery should be stuck --echo # Query execution is not allowed --echo # --let $group_replication_member_state= RECOVERING --source ../inc/gr_wait_for_member_state.inc --let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.tables WHERE table_name = 't1' --source include/wait_condition.inc # install plugin return before set super_read_only, wait to confirm change --let $wait_condition= SELECT @@GLOBAL.super_read_only = '1' --source include/wait_condition.inc --error ER_OPTION_PREVENTS_STATEMENT INSERT INTO t1 VALUES (2); --echo # --echo # After unblocking recovery all should be fine --echo # --connection server1 --source ../inc/gr_start_applier_sql_thread.inc --connection server2 --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc # The data should be there. --let $wait_condition= SELECT COUNT(*) = 1 FROM t1; --source include/wait_condition.inc --echo # --echo # Clean up --echo # DROP TABLE t1; --source include/rpl_sync.inc #Stop group replication and set the auto_increment values recorded on start --source include/stop_group_replication.inc # reset auto_increment variables from initial saved values in # store_group_replication_auto_increment.inc --let $rpl_server_number=2 --source include/restore_group_replication_auto_increment.inc --source ../inc/group_replication_end.inc