Server IP : 172.67.216.182 / Your IP : 162.158.107.65 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/mysql-test/suite/group_replication/t/ |
Upload File : |
################################################################################ # Validate that is not possible to change GTID_MODE to # others modes except ON when Group Replication is running. # # Test: # 0. The test requires two servers: M1 and M2. # 1. With members ONLINE. On M1, validate that it is not possible to change # GTID_MODE to others modes except ON when Group Replication is running. # 2. Stop GR on M1 to make it OFFLINE. Then validate that it is possible to # change GTID_MODE to others modes than ON when Group Replication is not # running. But start group replication will fail after that. # 3. Change GTID_MODE back to ON and Start GR on M1. Check that Group # Replication is working fine by creating table and adding some data into it. # 4. Check that GTID_EXECUTED on M1 contains all transactions. Also check that # data is on tables. # 5. Clean up. ################################################################################ --let $group_replication_group_name= 8a94f357-aab4-11df-86ab-c80aa9429490 --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc # Keep binary logs with only GTIDs from test. --connection server1 SET SESSION sql_log_bin= 0; --source include/gtid_utils.inc SET SESSION sql_log_bin= 1; --connection server2 SET SESSION sql_log_bin= 0; --source include/gtid_utils.inc SET SESSION sql_log_bin= 1; --let $expected_gtid_set= "8a94f357-aab4-11df-86ab-c80aa9429490:1-5" --echo --echo ############################################################ --echo # 1. Validate that it is not possible to change GTID_MODE to --echo # others modes except ON when Group Replication is running. --connection server1 --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME SET @@GLOBAL.GTID_MODE= OFF; --let $assert_text= GTID_MODE must be ON --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "ON" --source include/assert.inc --error ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME SET @@GLOBAL.GTID_MODE= OFF_PERMISSIVE; --let $assert_text= GTID_MODE must be ON --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "ON" --source include/assert.inc --error ER_CANT_SET_GTID_MODE SET @@GLOBAL.GTID_MODE= ON_PERMISSIVE; --let $assert_text= GTID_MODE must be ON --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "ON" --source include/assert.inc SET @@GLOBAL.GTID_MODE= ON; --let $assert_text= GTID_MODE must be ON --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "ON" --source include/assert.inc --echo --echo ############################################################ --echo # 2. Validate that it is possible to change GTID_MODE to other --echo # modes than ON when Group Replication is not running. --echo # But start group replication will fail after that. --source include/stop_group_replication.inc SET @@GLOBAL.GTID_MODE= ON_PERMISSIVE; --let $assert_text= GTID_MODE must be ON_PERMISSIVE --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "ON_PERMISSIVE" --source include/assert.inc --error ER_GROUP_REPLICATION_CONFIGURATION START GROUP_REPLICATION; SET @@GLOBAL.GTID_MODE= OFF_PERMISSIVE; --let $assert_text= GTID_MODE must be OFF_PERMISSIVE --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "OFF_PERMISSIVE" --source include/assert.inc --error ER_GROUP_REPLICATION_CONFIGURATION START GROUP_REPLICATION; SET @@GLOBAL.GTID_MODE= OFF; --let $assert_text= GTID_MODE must be OFF --let $assert_cond= "[SELECT @@GLOBAL.GTID_MODE]" = "OFF" --source include/assert.inc --error ER_GROUP_REPLICATION_CONFIGURATION START GROUP_REPLICATION; SET SESSION sql_log_bin= 0; call mtr.add_suppression("Gtid mode should be ON for Group Replication"); SET SESSION sql_log_bin= 1; --echo --echo ############################################################ --echo # 3. Change GTID_MODE back to ON and check that Group --echo # Replication will work properly. SET @@GLOBAL.GTID_MODE= OFF_PERMISSIVE; SET @@GLOBAL.GTID_MODE= ON_PERMISSIVE; SET @@GLOBAL.GTID_MODE= ON; --source include/start_group_replication.inc CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --source include/rpl_sync.inc --echo --echo ############################################################ --echo # 4. Check that GTID_EXECUTED on server 1 contains all --echo # transactions. --echo # Also check that data is on tables. --connection server1 --let $assert_text= GTID_EXECUTED must contain all committed GTIDs --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, $expected_gtid_set) --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 --connection server2 --let $assert_text= GTID_EXECUTED must contain all committed GTIDs --let $assert_cond= GTID_IS_EQUAL(@@GLOBAL.GTID_EXECUTED, $expected_gtid_set) --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 --echo --echo ############################################################ --echo # 5. Clean up. DROP TABLE t1; --connection server1 SET SESSION sql_log_bin= 0; --source include/gtid_utils_end.inc SET SESSION sql_log_bin= 1; --connection server2 SET SESSION sql_log_bin= 0; --source include/gtid_utils_end.inc SET SESSION sql_log_bin= 1; --source ../inc/group_replication_end.inc