Server IP : 172.67.216.182 / Your IP : 172.70.147.3 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/src/mysql-test/suite/rpl/t/ |
Upload File : |
# In this test we make sure that the slave does a recovery when the it is # brought up after it has stopped due to error in one or more of its workers. --source include/not_group_replication_plugin.inc -- source include/have_debug.inc -- source include/not_valgrind.inc -- source include/master-slave.inc --let $debug_point=set_commit_parent_100 --source include/add_debug_point.inc # set up the tables and replicate it to the slave. CREATE TABLE t1 (a int primary key) engine=innodb; CREATE TABLE t2 (a int primary key) engine=innodb; CREATE TABLE t3 (a int primary key) engine=innodb; CREATE TABLE t4 (a int primary key) engine=innodb; -- source include/sync_slave_sql_with_master.inc -- source include/stop_slave_sql.inc --let $debug_point=crash_in_a_worker --source include/add_debug_point.inc -- connection master --let $debug_point=set_commit_parent_100 --source include/remove_debug_point.inc --let $debug_point=set_commit_parent_150 --source include/add_debug_point.inc # execute transactions # trx1 should be applied and its worker released for receiving more work. # trx2 to trx5 are prepared in a way that they will be scheduled on the slave # but will not be applied. In order to have all four transactions scheduled, # the coordinator will have to distribute work by all four workers. The test # case expects the slave to crash after some workload be distributed to the # worker #2. # trx1 INSERT INTO t1 values (0); # trx2 should not complete on the slave. BEGIN; INSERT INTO t2 values (1),(2),(3); UPDATE t2 SET a= a+1 WHERE a=3; COMMIT; # trx3 should not complete on the slave. BEGIN; INSERT INTO t3 values (1),(2),(3); UPDATE t3 SET a= a+1 WHERE a=3; COMMIT; # trx4 should not complete on the slave. BEGIN; INSERT INTO t4 values (1),(2),(3); UPDATE t4 SET a= a+1 WHERE a=3; COMMIT; # trx5 should not complete on the slave. BEGIN; INSERT INTO t1 values (1),(2),(3); UPDATE t1 SET a= a+1 WHERE a=3; COMMIT; --let $debug_point=set_commit_parent_150 --source include/remove_debug_point.inc # Make sure the workload is already on the relay log before starting the # applier to avoid issues with slow systems. --source include/sync_slave_io_with_master.inc # This should prevent trx2 to trx5 from committing and will make all # four MTS workers to be busy regardless of server speed. --source include/rpl_connection_slave1.inc BEGIN; INSERT INTO t1 (a) VALUES (4); INSERT INTO t2 (a) VALUES (4); INSERT INTO t3 (a) VALUES (4); INSERT INTO t4 (a) VALUES (4); --source include/rpl_connection_slave.inc # make sure mtr expects a crash & restarts -- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect START SLAVE; -- source include/wait_until_disconnected.inc -- let $rpl_server_number= 2 -- source include/rpl_start_server.inc -- enable_reconnect -- echo # Reconnecting to the slave server -- source include/wait_until_connected_again.inc -- connection slave START SLAVE UNTIL SQL_AFTER_MTS_GAPS; # we need to send an additional event since the UNTIL CONDITION # needs an aditional event after the failed group to stop the slave # due to buf in until conditions -- connection master CREATE TABLE t5 (a int); -- connection slave -- source include/wait_for_slave_sql_to_stop.inc -- source include/start_slave.inc # cleanup -- connection master DROP TABLES t1, t2, t3, t4, t5; -- connection master -- source include/sync_slave_sql_with_master.inc -- source include/rpl_end.inc