Server IP : 172.67.216.182 / Your IP : 172.69.176.45 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 test a recovery race condition against member changes. # When start and stops are done sequentially, there was a chance that recovery # would see a one member group and think it was alone declaring the node online # in the log # # Test: # 0. The test requires two servers: M1 and M2. # 1. Bootstrap start a group on M1. # 2. Set DEBUG point on M2 to wait right before the process decides if the # server is alone. Start GR on M2. Check member_state is RECOVERING. # 3. On another connection of M2 stop GR. # 4. Signal recovery to continue on M2. Check member_state is OFFLINE. # 5. To test everything is working fine, add data on M1 and start GR on M2. # Validate data on M2. # 6. Clean up. ################################################################################ --source include/have_debug.inc --source include/have_debug_sync.inc --let $group_replication_group_name= 572e4320-cd68-11e4-8830-0800200c9a66 --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source ../inc/group_replication.inc --echo # --echo # Start group replication on the first server --echo # --connection server1 --echo server1 --source ../inc/start_and_bootstrap_group_replication.inc --echo # --echo # Start group replication on server 2 --echo # Wait right before the process decides if the server is alone. --echo # --connection server2 --echo server2 SET SESSION sql_log_bin= 0; call mtr.add_suppression("\\[GCS\\] Error pushing message into group communication engine."); call mtr.add_suppression("Error while sending stats message"); SET SESSION sql_log_bin= 1; SET @debug_save= @@GLOBAL.DEBUG; --echo # Set the debug flag to block recovery SET @@GLOBAL.DEBUG='d,recovery_thread_start_wait_num_of_members'; --let $group_replication_start_member_state= RECOVERING --source include/start_group_replication.inc #sleep to give time for the start to get stuck on recovery --sleep 5 --echo # --echo # On another connection stop group replication on server 2 --echo # --connection slave --send STOP GROUP_REPLICATION; --echo # --echo # Continue with recovery. --echo # --connection server2 #sleep to give time for the stop to make the number of members go to 1 --sleep 5 SET DEBUG_SYNC= "now SIGNAL signal.recovery_continue"; SET @@GLOBAL.DEBUG= @debug_save; --connection slave --reap --let $group_replication_member_state= OFFLINE --source ../inc/gr_wait_for_member_state.inc --source include/assert_and_disable_read_only.inc --echo # --echo # Test if the servers are working properly --echo # --connection server1 --echo server1 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --connection server2 --echo server2 --source include/start_group_replication.inc --let $assert_text= On the recovered member, the table should exist and have 1 elements; --let $assert_cond= [select count(*) from t1] = 1; --source include/assert.inc --echo # --echo # Clean up --echo # DROP TABLE t1; --source ../inc/group_replication_end.inc