Server IP : 104.21.38.3 / Your IP : 172.70.142.148 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/extra/rpl_tests/ |
Upload File : |
# ==== Purpose ==== # # Verify that on slave server, appropriate XA_STATE is reported in Performance # Schema tables for XA transactions. # # ==== Implementation ==== # # 1) On Master start one XA transaction named 'xatest' and set the state to # 'PREPARED'. # 2) On slave wait till the applier thread applies the 'XA PREPARE' statement. # 3) Verify that the XA_STATE is reported as 'PREPARED' in performance schema # table. # 4) On Master COMMIT the XA transaction. # 5) On slave verify that the XA_STATE is reported as 'COMMITTED' # # ==== References ==== # # Bug#25940184: P_S TRANSACTION INSTRUMENTATION DOES NOT WORK PROPERLY FOR # XA ON SLAVE --source include/rpl_connection_slave.inc TRUNCATE TABLE performance_schema.events_transactions_current; --source include/rpl_connection_master.inc --let $master_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1) CREATE TABLE t ( f INT) ENGINE=INNODB; XA START 'xatest'; INSERT INTO t VALUES (10); XA END 'xatest'; XA PREPARE 'xatest'; --let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1) --let $master_file= query_get_value(SHOW MASTER STATUS, File, 1) --source include/rpl_connection_slave.inc --echo # Wait until SQL thread reaches desired master binlog position --let $slave_param= Relay_Master_Log_File --let $slave_param_value= $master_file --let $slave_param_comparison= = --source include/wait_for_slave_param.inc --let $slave_param= Exec_Master_Log_Pos --let $slave_param_value= $master_pos --let $slave_param_comparison= >= --source include/wait_for_slave_param.inc XA RECOVER; --echo #################################################################### --echo # Asserting XA_STATE is PREPARED on Slave --echo #################################################################### --let $assert_text= Verify that XA_STATE is set PREPARED. --let $assert_cond=count(*)=1 FROM performance_schema.events_transactions_current WHERE XID_GTRID=\'xatest\' AND XA_STATE=\'PREPARED\' --source include/assert.inc --source include/rpl_connection_master.inc XA COMMIT 'xatest'; --source include/sync_slave_sql_with_master.inc XA RECOVER; --echo #################################################################### --echo # Asserting XA_STATE is COMMITTED on Slave --echo #################################################################### --let $assert_text= Verify that XA_STATE is set COMMITTED. --let $assert_cond=count(*)=1 FROM performance_schema.events_transactions_current WHERE XID_GTRID=\'xatest\' AND XA_STATE=\'COMMITTED\' --source include/assert.inc if ($gtid_mode == ON) { --let $gno_0 = 3 --let $expected_gtid = $master_uuid:$gno_0 --let $assert_text= Expected gtid is MASTER_UUID:$gno_0 --let $assert_cond= "[SELECT GTID FROM performance_schema.events_transactions_current where XID_GTRID=\'xatest\']" = "$expected_gtid" --source include/assert.inc } --let $diff_tables=master:t,slave:t --source include/diff_tables.inc --source include/rpl_connection_master.inc DROP TABLE t; --source include/sync_slave_sql_with_master.inc