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_multiple_version_members.test |
################################################################################ # This test validates the functioning of the version handshake algorithm on # group replication. # The test makes the group go through several changes involving different member # versions validating the expected outcome on each case. # The test script is: # *) The test requires five servers: S1, S2, S3, S4 and S5. # # Server Step Version (to base) Outcome #------------------------------------------------------------------------------- # (S1) join member with a higher patch version* (patch version + 1) OK # (S2) join member with a higher minor version (minor version + 1) OK # (S3) join member with the base version (base version) OK # (S3) member leaves # (S3) join member with a higher major version (major version +1) OK # (S4) join member with a higher minor version (minor version + 1) OK # (S1) member leaves # (S2) member leaves # (S5) join member with the base version (base version) OK # (S4) member leaves # (S5) member leaves # (S5) join member with the base version (base version) Failure # # *) The group start happens with Server 1 joining # # The base version is version of the plugin associated with this test: # Version= MAJOR.MINOR.PATCH # ################################################################################ --source include/not_valgrind.inc --source include/big_test.inc --source include/have_debug.inc --let $group_replication_group_name= 8a1da670-05fa-11e5-b939-0800200c9a66 --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --let $rpl_server_count= 5 --source ../inc/group_replication.inc --echo # --echo # Check the version of member 1 is fully visible in the plugin table --echo # --let $assert_text= The plugin major and minor versions are visible in the version column --let $assert_cond= [SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME= "group_replication" and PLUGIN_VERSION= "1.0" ] = 1; --source include/assert.inc --let $assert_text= The plugin total version can be seen in the description column --let $assert_cond= [SELECT COUNT(*) FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME= "group_replication" and PLUGIN_DESCRIPTION= "Group Replication (1.0.0)" ] = 1; --source include/assert.inc --echo # --echo # Setup a new member with version a higher patch version --echo # Version= Base version + 1 patch version --echo # --connection server1 --echo server1 SET @debug_saved_s1= @@GLOBAL.DEBUG; SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_patch_version'; --source ../inc/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 with a higher minor version --echo # Version = Base version + 1 minor version --echo # The member will join the group as there are other members with the --echo # same major version --echo # --connection server2 --echo server2 SET @debug_saved_s2= @@GLOBAL.DEBUG; # Cause the member to broadcast and compare himself using a higher version SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_minor_version'; --source include/start_group_replication.inc # Check the data is there --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 # Try to add a new member with a base version. --echo # Version = Base version --echo # It will succeed since the major version is the same --echo # --connection server3 --echo server3 --source include/start_group_replication.inc --echo # --echo # Try to add a new member with a higher major version --echo # Version = Base version + 1 major version --echo # The member will join the group --echo # --source include/stop_group_replication.inc SET @debug_saved_s3= @@GLOBAL.DEBUG; # Cause the member to broadcast and compare himself using a higher version SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_major_version'; --source include/start_group_replication.inc # Check the data is there --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 # Add server 4 with a higher minor version than base --echo # Version = Base version + 1 minor version --echo # The member will join the group as there are other members with the --echo # same major version --echo # --connection server4 --echo server4 SET @debug_saved_s4= @@GLOBAL.DEBUG; SET @@GLOBAL.DEBUG= '+d,group_replication_compatibility_higher_minor_version'; --source include/start_group_replication.inc # Check the data is there --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 # Remove server 1 and server 2 --echo # Try to add a new member with a base version than member 1 --echo # Version = Base version --echo # The member will join the group because of server 4 which has --echo # same major version --echo # --connection server1 --echo server1 --source include/stop_group_replication.inc --connection server2 --echo server2 --source include/stop_group_replication.inc --connection server5 --echo server5 --source include/start_group_replication.inc # Check the data is there --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 # Remove all servers with base major version. --echo # Try to add a new member with a base version. --echo # Version = Base version --echo # The member will not join the group because of server 3 --echo # has higher major version. --echo # --connection server4 --echo server4 --source include/stop_group_replication.inc --connection server5 --echo server5 --source include/stop_group_replication.inc 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" --error ER_GROUP_REPLICATION_CONFIGURATION START GROUP_REPLICATION; --echo # --echo # Clean up --echo # --connection server3 --echo server3 --source include/stop_group_replication.inc SET @@GLOBAL.DEBUG= @debug_save_s3; --source ../inc/start_and_bootstrap_group_replication.inc --connection server1 --echo server1 SET @@GLOBAL.DEBUG= @debug_save_s1; --source include/start_group_replication.inc --connection server2 --echo server2 SET @@GLOBAL.DEBUG= @debug_save_s2; --source include/start_group_replication.inc --connection server4 --echo server4 SET @@GLOBAL.DEBUG= @debug_save_s4; --source include/start_group_replication.inc --connection server5 --echo server5 --source include/start_group_replication.inc DROP TABLE t1; --source ../inc/group_replication_end.inc