Server IP : 172.67.216.182 / Your IP : 162.158.162.38 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 : |
################################################################################ # This test intends to prove that members can survive reset master commands. # These commands end up causing the members to purge their relay logs # # Test: # 0. The test requires two servers: M1 and M2. # 1. On M1, test a reset master command before start GR. It MUST be successful. # 2. Bootstrap start a group on M1. Start GR on M2. # 3. Create a table and insert some data. # 4. Validate both members must have the same GTID set. # 5. Stop GR and reset master on both members. # 6. Restart both members (Bootstrap start a group on M2. Start GR on M1). # 7. Insert some data to test that the group is still running. # 8. Run RESET MASTER while GR is running. It must fail. # 9. Clean up. ################################################################################ --source ../inc/have_group_replication_gtid_assignment_block_size_1.inc --let $group_replication_group_name= c90c3c80-fde4-11e3-a3ac-0800200c9a66 --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source ../inc/group_replication.inc --connection server1 --echo #Test a reset command before start. RESET MASTER; --source ../inc/start_and_bootstrap_group_replication.inc --connection server2 --source include/start_group_replication.inc --echo #Create a table and insert some data --connection server1 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; --let $sync_slave_connection= server2 --source include/sync_slave_sql_with_master.inc --connection server2 INSERT INTO t1 VALUES (1); --connection server1 INSERT INTO t1 VALUES (2); --let $sync_slave_connection=server2 --source include/sync_slave_sql_with_master.inc --connection server2 INSERT INTO t1 VALUES (3); --let $sync_slave_connection=server1 --source include/sync_slave_sql_with_master.inc --echo #Both members must have the same GTID set --let $server_count=2 while ($server_count) { --connection server$server_count --let $assert_text= On member $server_count, all executed GTID should belong to the group --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "c90c3c80-fde4-11e3-a3ac-0800200c9a66:1-6"; --source include/assert.inc --dec $server_count } --echo #Stop and reset both members --connection server1 --source include/stop_group_replication.inc RESET MASTER; --connection server2 --source include/stop_group_replication.inc RESET MASTER; --echo #Restart both members --source ../inc/start_and_bootstrap_group_replication.inc --connection server1 --source include/start_group_replication.inc --echo #Both members must have an empty gtid set --let $server_count=2 while ($server_count) { --connection server$server_count --let $assert_text= On member $server_count, there should only 2 transactions from view changes --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "c90c3c80-fde4-11e3-a3ac-0800200c9a66:1-2"; --source include/assert.inc --dec $server_count } --echo #Insert some data to test that the group is still running INSERT INTO t1 VALUES (4); --let $sync_slave_connection=server2 --source include/sync_slave_sql_with_master.inc INSERT INTO t1 VALUES (5); --let $sync_slave_connection=server1 --source include/sync_slave_sql_with_master.inc --let $server_count=2 while ($server_count) { --connection server$server_count --let $assert_text= On member $server_count, the table should exist and have 5 elements --let $assert_cond= [select count(*) from t1] = 5; --source include/assert.inc --dec $server_count } --echo # Run RESET MASTER while Group Replication is running must fail --error ER_CANT_RESET_MASTER RESET MASTER; --echo # Clean up DROP TABLE t1; --source ../inc/group_replication_end.inc