Server IP : 104.21.38.3 / Your IP : 162.158.106.62 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 evaluates that recovery fails properly when the donors available # have conflicting data. # # The test steps are: # 0) The test requires two servers: M1 and M2. # 1) Bootstrap start M1. Create table t1 and insert some data for recovery. # 2) Create table t1 on M2 before starting. Start GR on M2. # 3) With a low number of retries watch recovery fail on M2. It should go # to ERROR state. # 4) Remove the data in the joiner M2 and restart GR. All is OK. Validate # data. # 5) Clean up. ################################################################################ --let $group_replication_group_name=c1ef5e40-262a-11e5-867f-0800200c9a66 --source ../inc/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source ../inc/group_replication.inc --echo # --echo # Setup a new group --echo # --connection server1 --echo server1 --source ../inc/start_and_bootstrap_group_replication.inc --echo # Add some data for recovery CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --echo # --echo # Add the same data to member 2 before the joining phase --echo # --connection server2 --echo server2 --echo # Add some data to crash recovery CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (2); --echo # --echo # Start group replication on member 2 and it goes to an ERROR state --echo # SET SESSION sql_log_bin= 0; call mtr.add_suppression("Slave SQL for channel 'group_replication_recovery': Error 'Table 't1' already exists'*"); call mtr.add_suppression("Slave: Table 't1' already exists*"); call mtr.add_suppression("Slave SQL for channel 'group_replication_recovery': Worker .* failed executing transaction .*; Error 'Table 't1' already exists' on query."); call mtr.add_suppression("Slave SQL for channel 'group_replication_recovery': ... The slave coordinator and worker threads are stopped.*"); call mtr.add_suppression("Maximum number of retries when*"); call mtr.add_suppression("Fatal error during the Recovery process of Group Replication. The server will leave the group."); call mtr.add_suppression(".*This member has more executed transactions *.*"); call mtr.add_suppression("The member contains transactions not present in the group. It is only allowed to *.*"); call mtr.add_suppression("The member is leaving a group without being on one"); call mtr.add_suppression("The member is already leaving or joining a group."); call mtr.add_suppression("Error leaving the group"); call mtr.add_suppression("Skipping leave operation: concurrent attempt to leave the group is on-going."); SET SESSION sql_log_bin= 1; SET @debug_save_retries= @@GLOBAL.group_replication_recovery_retry_count; SET GLOBAL group_replication_recovery_retry_count= 1; SET GLOBAL group_replication_allow_local_disjoint_gtids_join= 1; --let $group_replication_start_member_state= ERROR --source include/start_group_replication.inc --echo # --echo # Remove the conflicting data and see that all goes fine now --echo # --source include/stop_group_replication.inc DROP TABLE t1; # Reset the server GTIDs so rpl_end don't blocks RESET MASTER; SET @@GLOBAL.group_replication_recovery_retry_count= @debug_save_retries; SET GLOBAL group_replication_allow_local_disjoint_gtids_join= 0; --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 # Cleaning up --echo # DROP TABLE t1; --source ../inc/group_replication_end.inc