MINI MINI MANI MO
################################################################################
# This test proves that skipping a View Change Event is possible.
# To test this, a View Change is generated when one of the servers has
# its applier stopped. We then inject an empty transaction and see that the
# View Change was skipped.
#
# Test:
# 0. The test requires three servers: M1, M2 and M3.
# 1. Bootstrap start a group on M1. Start GR on M2.
# 2. Stop applier thread on M2. Stop GR on M1.
# 3. On M2, skip the View Change Event generated when M1 left.
# 4. Start applier thread on M2.
# 5. Start GR on M3. Verify sequence of events in binlog. There must be empty
# transaction for UUID_GROUP:3 i.e. instead of view change event from M1.
################################################################################
--let $group_replication_group_name= fc0d4480-abd1-11e4-bcd8-0800200c9a66
--source ../inc/have_group_replication_plugin.inc
--let $rpl_server_count= 3
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc
# The sequence of events that make up a View Change
--let $vcle_seq= Gtid # Query/BEGIN # View_change # Query/COMMIT
# The sequence of events that make up an empty transaction
--let $empty_seq= Gtid # Query/BEGIN # Query/COMMIT
--echo #
--echo # Setup a new server group
--echo #
--connection server1
--echo server1
--source ../inc/start_and_bootstrap_group_replication.inc
--connection server2
--echo server2
--source include/start_group_replication.inc
--echo #
--echo # Stop the applier on server 2 and stop group replication on server 1
--echo #
--connection server2
--echo server2
STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
--connection server1
--echo server1
--source include/stop_group_replication.inc
--echo #
--echo # Skip the View Change Event generated when server 1 left
--echo #
--connection server2
--echo server2
--eval SET @@SESSION.GTID_NEXT= "$group_replication_group_name:3"
BEGIN;
COMMIT;
SET GTID_NEXT='AUTOMATIC';
START SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier";
--echo #
--echo # Check on server 3 that one of the View Change events was skipped
--echo #
--connection server3
--echo server3
--source include/start_group_replication.inc
# VCE (s1 joined) | VCE (s2 joined) | Skipped VCE (s1 left) | VCE (s3 joined)
--let $event_sequence= $vcle_seq # $vcle_seq # $empty_seq # $vcle_seq
--source include/assert_binlog_events.inc
--source ../inc/group_replication_end.inc
OHA YOOOO