| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Verify that on slave server, appropriate XA_STATE is reported in Performance |
| 4 |
# Schema tables for XA transactions. |
| 5 |
# |
| 6 |
# ==== Implementation ==== |
| 7 |
# |
| 8 |
# 1) On Master start one XA transaction named 'xatest' and set the state to |
| 9 |
# 'PREPARED'. |
| 10 |
# 2) On slave wait till the applier thread applies the 'XA PREPARE' statement. |
| 11 |
# 3) Verify that the XA_STATE is reported as 'PREPARED' in performance schema |
| 12 |
# table. |
| 13 |
# 4) On Master COMMIT the XA transaction. |
| 14 |
# 5) On slave verify that the XA_STATE is reported as 'COMMITTED' |
| 15 |
# 6) Ensure that XA COMMIT statment's GTID is the same as that of master. |
| 16 |
# |
| 17 |
# ==== References ==== |
| 18 |
# |
| 19 |
# Bug#25940184: P_S TRANSACTION INSTRUMENTATION DOES NOT WORK PROPERLY FOR |
| 20 |
# XA ON SLAVE |
| 21 |
|
| 22 |
# Test script is independent of binlog format. |
| 23 |
--source include/have_binlog_format_mixed.inc |
| 24 |
--source include/master-slave.inc |
| 25 |
|
| 26 |
# Verify |
| 27 |
--source extra/rpl_tests/rpl_perfschema_applier_xa_status.test |
| 28 |
|
| 29 |
# Cleanup |
| 30 |
--source include/rpl_reset.inc |
| 31 |
|
| 32 |
--echo #################################################################### |
| 33 |
--echo # Test Case 2: Enable Multithreaded Slave with replica_parallel_type as |
| 34 |
--echo # DATABASE. Verify that slave displays appropriate XA_STATE in |
| 35 |
--echo # performance schema table, post XA PREPARE AND XA COMMIT command |
| 36 |
--echo # execution. |
| 37 |
--echo #################################################################### |
| 38 |
--source include/rpl_connection_slave.inc |
| 39 |
|
| 40 |
# Save existing settings. |
| 41 |
SET @save_replica_parallel_workers=@@global.replica_parallel_workers; |
| 42 |
SET @replica_parallel_type=@@global.replica_parallel_type; |
| 43 |
|
| 44 |
# Enable MTS |
| 45 |
--source include/stop_slave.inc |
| 46 |
SET GLOBAL replica_parallel_workers=4; |
| 47 |
SET GLOBAL replica_parallel_type='DATABASE'; |
| 48 |
--source include/start_slave.inc |
| 49 |
|
| 50 |
# Verify |
| 51 |
--source extra/rpl_tests/rpl_perfschema_applier_xa_status.test |
| 52 |
|
| 53 |
# Cleanup |
| 54 |
--source include/rpl_reset.inc |
| 55 |
|
| 56 |
--echo #################################################################### |
| 57 |
--echo # Test Case 3: Enable Multithreaded Slave with replica_parallel_type as |
| 58 |
--echo # LOGICAL_CLOCK. Verify that slave displays appropriate XA_STATE in |
| 59 |
--echo # performance schema table, post XA PREPARE AND XA COMMIT command |
| 60 |
--echo # execution. |
| 61 |
--echo #################################################################### |
| 62 |
|
| 63 |
# Enable MTS |
| 64 |
--source include/stop_slave.inc |
| 65 |
SET GLOBAL replica_parallel_workers=4; |
| 66 |
SET GLOBAL replica_parallel_type='LOGICAL_CLOCK'; |
| 67 |
--source include/start_slave.inc |
| 68 |
|
| 69 |
# Verify |
| 70 |
--source extra/rpl_tests/rpl_perfschema_applier_xa_status.test |
| 71 |
|
| 72 |
--source include/rpl_connection_slave.inc |
| 73 |
|
| 74 |
# Cleanup |
| 75 |
--source include/stop_slave.inc |
| 76 |
set @@global.replica_parallel_workers= @save_replica_parallel_workers; |
| 77 |
set @@global.replica_parallel_type= @replica_parallel_type; |
| 78 |
--source include/start_slave.inc |
| 79 |
|
| 80 |
--source include/rpl_end.inc |