Server IP : 104.21.38.3 / Your IP : 162.158.106.69 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 : |
# # Test that in MSR+MTS setup, a worker retries a transaction # for a channel # Idea of the test: # 1. setup a named replication channel to a master # 2. Lock the tables on a slave # 3. Replicate the data to the same table # 4. See that the worker retries transaction and transaction retry count # is increased. # 5. Do Roll back on the slave. # 6. Check that data on the master and slave is same as retry of the # transaction this time will be succesful # --source include/not_group_replication_plugin.inc --source include/only_mts_slave_parallel_workers.inc --echo # Create channel_1 to server_1 from server_2(slave) --let $rpl_topology= 1->2 --let $rpl_multi_source =1 --source include/rpl_init.inc --echo # --echo # Insert data on the master --echo # --let $rpl_connection_name= server_1 --source include/rpl_connection.inc CREATE TABLE t1( a int unique); --echo # sync data to the slave --let $rpl_connection_name= server_1 --source include/rpl_connection.inc --let $rpl_channel_name= channel_1 --let $sync_slave_connection= server_2 --source include/sync_slave_sql_with_master.inc --echo # stop slave --source include/rpl_stop_slaves.inc # Backup the original value of the variables SET @saved_innodb_lock_wait_timeout = @@GLOBAL.innodb_lock_wait_timeout; SET @saved_slave_transaction_retries = @@GLOBAL.slave_transaction_retries; --echo # --echo # Set the variables needed for this test --echo # SET GLOBAL slave_transaction_retries=10; SET GLOBAL innodb_lock_wait_timeout=2; --echo #start slave --source include/rpl_start_slaves.inc --echo # --echo # Lock the rows of the table t1 --echo # BEGIN; INSERT INTO t1 VALUES(1); --echo # --echo # Insert the rows on the same table on master --echo # --let $rpl_connection_name= server_1 --source include/rpl_connection.inc INSERT INTO t1 VALUES(1); --echo # --echo # On slave, check that this transaction from the master has been retried. --echo # --let $rpl_connection_name= server_2 --source include/rpl_connection.inc --let $wait_timeout=60 --let $wait_condition= SELECT COUNT_TRANSACTIONS_RETRIES>=2 FROM performance_schema.replication_applier_status WHERE channel_name="channel_1"; --source include/wait_condition.inc --echo # Release the lock. ROLLBACK; --echo # Now sync with master on channel_1 --let $rpl_connection_name= server_1 --source include/rpl_connection.inc --let $rpl_channel_name= channel_1 --let $sync_slave_connection= server_2 --source include/sync_slave_sql_with_master.inc --echo # check that data shows the value 1 SELECT * FROM t1; --echo #cleanup --let $rpl_connection_name= server_1 --source include/rpl_connection.inc DROP TABLE t1; --let $rpl_channel_name= channel_1 --let $sync_slave_connection= server_2 --source include/sync_slave_sql_with_master.inc # restore the old values SET GLOBAL innodb_lock_wait_timeout = @saved_innodb_lock_wait_timeout; SET GLOBAL slave_transaction_retries = @saved_slave_transaction_retries; --let $rpl_skip_sync=1 --source include/rpl_end.inc