| 1 |
################################################################################ |
| 2 |
# This test checks that if a joiner has a lower version than the members in a |
| 3 |
# group it wont be able to join it |
| 4 |
# To test this, we start member 1, and then try to start member 2 where we |
| 5 |
# set a fake lower version. |
| 6 |
# |
| 7 |
# Test: |
| 8 |
# 0. The test requires two servers: M1 and M2. |
| 9 |
# 1. Set DEBUG point in M1 so that its version become higher than M2 and |
| 10 |
# bootstrap it. Add some data for recocvery. |
| 11 |
# 2. Try to add M2 which is lower version than M1. Expect failure. |
| 12 |
# 3. Check all is fine when both members have same version. |
| 13 |
# 4. Clean up. |
| 14 |
################################################################################ |
| 15 |
|
| 16 |
--source include/big_test.inc |
| 17 |
--source include/have_debug.inc |
| 18 |
--let $group_replication_group_name= 6f6932e0-03d9-11e5-b939-0800200c9a66 |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--let $rpl_skip_group_replication_start= 1 |
| 21 |
--source include/group_replication.inc |
| 22 |
|
| 23 |
--echo # |
| 24 |
--echo # Setup a member in a way that his version is higher than member 2 |
| 25 |
--echo # |
| 26 |
|
| 27 |
--connection server1 |
| 28 |
--echo server1 |
| 29 |
|
| 30 |
SET @debug_saved= @@GLOBAL.DEBUG; |
| 31 |
SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_major_version'; |
| 32 |
|
| 33 |
--source include/start_and_bootstrap_group_replication.inc |
| 34 |
|
| 35 |
# Add some data for recovery |
| 36 |
|
| 37 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 38 |
INSERT INTO t1 VALUES (1); |
| 39 |
|
| 40 |
--echo # |
| 41 |
--echo # Try to add a new member that has a lower version than member 1 |
| 42 |
--echo # |
| 43 |
|
| 44 |
--connection server2 |
| 45 |
--echo server2 |
| 46 |
|
| 47 |
SET session sql_log_bin=0; |
| 48 |
call mtr.add_suppression("Member version is incompatible with the group"); |
| 49 |
SET session sql_log_bin=1; |
| 50 |
|
| 51 |
SET GLOBAL group_replication_group_name= "6f6932e0-03d9-11e5-b939-0800200c9a66"; |
| 52 |
|
| 53 |
# The start will fail as the node is declared incompatible with the group |
| 54 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 55 |
START GROUP_REPLICATION; |
| 56 |
|
| 57 |
--echo # |
| 58 |
--echo # Check all is fine when both have the same version |
| 59 |
--echo # |
| 60 |
|
| 61 |
--connection server1 |
| 62 |
--echo server1 |
| 63 |
|
| 64 |
SET @@GLOBAL.DEBUG= @debug_save; |
| 65 |
--source include/stop_group_replication.inc |
| 66 |
--source include/start_and_bootstrap_group_replication.inc |
| 67 |
|
| 68 |
--connection server2 |
| 69 |
--echo server2 |
| 70 |
|
| 71 |
--source include/start_group_replication.inc |
| 72 |
|
| 73 |
--let $assert_text= On the recovered member, the table should contain 1 elements |
| 74 |
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 1; |
| 75 |
--source include/assert.inc |
| 76 |
|
| 77 |
--echo # |
| 78 |
--echo # Clean up |
| 79 |
--echo # |
| 80 |
|
| 81 |
DROP TABLE t1; |
| 82 |
|
| 83 |
--source include/group_replication_end.inc |