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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
################################################################################
# This test checks that if a joiner has a lower version than the members in a
# group and option group_replication_allow_local_lower_version_join is true it
# will be able to join the group.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Setup M1 in a way that its version is higher than M2 using DEBUG point.
# 2. Add some data for recovery.
# 3. Try to add a new member M2 that has a lower version than M1. The start
# will fail as the member is declared incompatible with the group.
# 4. Test basic check that group_replication_allow_local_lower_version_join
# variable doesn't accept invalid inputs.
# 5. After allowing that this server can join with a lower plugin version, M2
# will be able to join.
# 6. Check all is fine on M1 and M2.
# 7. Clean up.
################################################################################
--source include/big_test.inc
--source include/have_debug.inc
--let $group_replication_group_name= 6f6932e0-03d9-11e5-b939-0800200c9a12
--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;
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
# The start will fail as the member is declared incompatible with the group
--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;
# Basic check: Test that variable doesn't accept invalid inputs.
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_allow_local_lower_version_join= NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL group_replication_allow_local_lower_version_join= "a";
--error ER_WRONG_TYPE_FOR_VAR
SET GLOBAL group_replication_allow_local_lower_version_join= 1.2;
# After allowing that this server can join with a lower plugin version,
# server will be able to join.
SET GLOBAL group_replication_allow_local_lower_version_join= ON;
--source include/start_group_replication.inc
INSERT INTO t1 VALUES (2);
--source include/rpl_sync.inc
--echo #
--echo # Check all is fine
--echo #
--echo server1
--connection server1
--let $assert_text= GTID_EXECUTED must contain all committed GTIDs
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-6"
--source include/assert.inc
--let $assert_text= 'There is a value 1 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 2, count, 1] = 1
--source include/assert.inc
--echo server2
--connection server2
--let $assert_text= GTID_EXECUTED must contain all committed GTIDs
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$group_replication_group_name:1-6"
--source include/assert.inc
--let $assert_text= 'There is a value 1 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1
--source include/assert.inc
--let $assert_text= 'There is a value 2 in table t1'
--let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 2, count, 1] = 1
--source include/assert.inc
--echo #
--echo # Clean up
--echo #
--connection server1
DROP TABLE t1;
SET @@GLOBAL.DEBUG= @debug_save;
--source include/stop_group_replication.inc
--source include/start_group_replication.inc
--connection server2
SET GLOBAL group_replication_allow_local_lower_version_join= OFF;
--source include/group_replication_end.inc
|