Debian Codegraph @

mysql-test/suite/rpl_nogtid/t/rpl_perfschema_applier_xa_status_check.test

raw
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 #
16 # ==== References ====
17 #
18 # Bug#25940184: P_S TRANSACTION INSTRUMENTATION DOES NOT WORK PROPERLY FOR
19 # XA ON SLAVE
20
21 # Test script is independent of binlog format.
22 --source include/have_binlog_format_mixed.inc
23 # Separate test script exists for gtid enabled scenario named
24 # rpl_gtid_perfschema_applier_xa_status.test
25 --source include/master-slave.inc
26
27 --echo ####################################################################
28 --echo # Test Case 1: Simple MASTER-SLAVE setup.
29 --echo # Verify that slave displays appropriate XA_STATE in performance
30 --echo # schema table, post XA PREPARE AND XA COMMIT command execution.
31 --echo ####################################################################
32 --source extra/rpl_tests/rpl_perfschema_applier_xa_status.test
33 --source include/rpl_reset.inc
34
35 --echo ####################################################################
36 --echo # Test Case 2: Enable Multithreaded Slave with replica_parallel_type as
37 --echo # DATABASE. Verify that slave displays appropriate XA_STATE in
38 --echo # performance schema table, post XA PREPARE AND XA COMMIT command
39 --echo # execution.
40 --echo ####################################################################
41 --source include/rpl_connection_slave.inc
42
43 # Save existing settings.
44 SET @save_replica_parallel_workers=@@global.replica_parallel_workers;
45 SET @replica_parallel_type=@@global.replica_parallel_type;
46
47 # Enable MTS
48 --source include/stop_slave.inc
49 SET GLOBAL replica_parallel_workers=4;
50 SET GLOBAL replica_parallel_type='DATABASE';
51 --source include/start_slave.inc
52
53 # Verify
54 --source extra/rpl_tests/rpl_perfschema_applier_xa_status.test
55
56 # Cleanup
57 --source include/rpl_reset.inc
58
59 --echo ####################################################################
60 --echo # Test Case 3: Enable Multithreaded Slave with replica_parallel_type as
61 --echo # LOGICAL_CLOCK. Verify that slave displays appropriate XA_STATE in
62 --echo # performance schema table, post XA PREPARE AND XA COMMIT command
63 --echo # execution.
64 --echo ####################################################################
65
66 # Enable MTS
67 --source include/stop_slave.inc
68 SET GLOBAL replica_parallel_workers=4;
69 SET GLOBAL replica_parallel_type='LOGICAL_CLOCK';
70 --source include/start_slave.inc
71
72 # Verify
73 --source extra/rpl_tests/rpl_perfschema_applier_xa_status.test
74
75 --source include/rpl_connection_slave.inc
76
77 # Cleanup
78 --source include/stop_slave.inc
79 set @@global.replica_parallel_workers= @save_replica_parallel_workers;
80 set @@global.replica_parallel_type= @replica_parallel_type;
81 --source include/start_slave.inc
82
83 --source include/rpl_end.inc