84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
################################################################################
|
|
# This test checks that if a joiner has a lower version than the members in a
|
|
# group it wont be able to join it
|
|
# To test this, we start member 1, and then try to start member 2 where we
|
|
# set a fake lower version.
|
|
#
|
|
# Test:
|
|
# 0. The test requires two servers: M1 and M2.
|
|
# 1. Set DEBUG point in M1 so that its version become higher than M2 and
|
|
# bootstrap it. Add some data for recocvery.
|
|
# 2. Try to add M2 which is lower version than M1. Expect failure.
|
|
# 3. Check all is fine when both members have same version.
|
|
# 4. Clean up.
|
|
################################################################################
|
|
|
|
--source include/big_test.inc
|
|
--source include/have_debug.inc
|
|
--let $group_replication_group_name= 6f6932e0-03d9-11e5-b939-0800200c9a66
|
|
--source include/have_group_replication_plugin.inc
|
|
--let $rpl_skip_group_replication_start= 1
|
|
--source include/group_replication.inc
|
|
|
|
--echo #
|
|
--echo # Setup a member in a way that his version is higher than member 2
|
|
--echo #
|
|
|
|
--connection server1
|
|
--echo server1
|
|
|
|
SET @debug_saved= @@GLOBAL.DEBUG;
|
|
SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_major_version';
|
|
|
|
--source include/start_and_bootstrap_group_replication.inc
|
|
|
|
# Add some data for recovery
|
|
|
|
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES (1);
|
|
|
|
--echo #
|
|
--echo # Try to add a new member that has a lower version than member 1
|
|
--echo #
|
|
|
|
--connection server2
|
|
--echo server2
|
|
|
|
SET session sql_log_bin=0;
|
|
call mtr.add_suppression("Member version is incompatible with the group");
|
|
SET session sql_log_bin=1;
|
|
|
|
SET GLOBAL group_replication_group_name= "6f6932e0-03d9-11e5-b939-0800200c9a66";
|
|
|
|
# The start will fail as the node is declared incompatible with the group
|
|
--error ER_GROUP_REPLICATION_CONFIGURATION
|
|
START GROUP_REPLICATION;
|
|
|
|
--echo #
|
|
--echo # Check all is fine when both have the same version
|
|
--echo #
|
|
|
|
--connection server1
|
|
--echo server1
|
|
|
|
SET @@GLOBAL.DEBUG= @debug_save;
|
|
--source include/stop_group_replication.inc
|
|
--source include/start_and_bootstrap_group_replication.inc
|
|
|
|
--connection server2
|
|
--echo server2
|
|
|
|
--source include/start_group_replication.inc
|
|
|
|
--let $assert_text= On the recovered member, the table should contain 1 elements
|
|
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 1;
|
|
--source include/assert.inc
|
|
|
|
--echo #
|
|
--echo # Clean up
|
|
--echo #
|
|
|
|
DROP TABLE t1;
|
|
|
|
--source include/group_replication_end.inc
|