Server IP : 172.67.216.182 / Your IP : 104.23.175.211 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 a single member goes through recovery process, # consume existing applier relay log, even when it is the single # member of the group. # # Test: # 0. The test requires two servers. # 1. Stop SQL Threads on server2 so that all remote transactions are only queued # on relay log. Execute some transactions on server1. # 2. Wait until server2 receives and certifies the transaction. # 3. Make both members leave the group. # 4. Lock table on server2. Bootstrap start Group Replication only on server2. # Validate that Member state is RECOVERING, despite being the only group # member, since it is applying group applier relay log. Unlock tables. Wait # until server2 comes ONLINE. # 5. Assert that server1 and server2 have the same data and GTID_EXECUTED. # 6. Clean up. ################################################################################ --source include/have_debug.inc --source ../inc/have_group_replication_plugin.inc --source ../inc/group_replication.inc --echo ############################################################ --echo # 1. Stop SQL Threads on server2 so that all remote transactions --echo # are only queued on relay log. Execute some transactions on --echo # server1. --connection server1 CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; --source include/rpl_sync.inc --connection server2 STOP SLAVE SQL_THREAD FOR CHANNEL "group_replication_applier"; --connection server1 INSERT INTO t1 VALUES (1); --echo --echo ################################################################ --echo # 2. Wait until server2 receives and certifies the transaction. --connection server2 --let $wait_condition= SELECT (Count_transactions_checked - Count_conflicts_detected) = 2 from performance_schema.replication_group_member_stats --source include/wait_condition.inc --echo --echo ############################################################ --echo # 3. Make both members leave the group. --connection server1 --source include/stop_group_replication.inc --connection server2 --source include/stop_group_replication.inc --echo --echo ############################################################ --echo # 4. Start Group Replication only on server2. Validate that --echo # Member state is RECOVERING, despite being the only group --echo # member, since it is applying group applier relay log. # Force group applier relay log to wait on a table lock so that the # next wait_for_member_state is deterministic. --connection server_2 LOCK TABLE t1 WRITE; --connection server2 --source ../inc/gr_set_bootstrap_group.inc SET @debug_save= @@GLOBAL.DEBUG; SET GLOBAL debug= 'd,group_replication_skip_read_mode'; --let $group_replication_start_member_state= RECOVERING --source include/start_group_replication.inc --source ../inc/gr_clear_bootstrap_group.inc --connection server_2 UNLOCK TABLES; --connection server2 --let $group_replication_member_state= ONLINE --source ../inc/gr_wait_for_member_state.inc SET @@GLOBAL.DEBUG= @debug_save; --echo --echo ############################################################ --echo # 5. Assert that server1 and server2 have the same data and --echo # GTID_EXECUTED. --connection server1 --let $assert_text= 'There is a value 1 in table t1 on server1' --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= 'There is a value 1 in table t1 on server2' --let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1 --source include/assert.inc --connection server2 --let $server2_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED` --let $assert_text= 'server2 GTID_EXECUTED must contain the 2 transactions plus 3 view changes' --let $assert_cond= "$server2_gtid_executed" = "$group_replication_group_name:1-5" --source include/assert.inc --echo --echo ############################################################ --echo # 6. Clean up. --connection server1 --source include/start_group_replication.inc DROP TABLE t1; --source ../inc/group_replication_end.inc