| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection master] |
| 6 |
[connection slave] |
| 7 |
TRUNCATE TABLE performance_schema.events_transactions_current; |
| 8 |
---- Setup ---- |
| 9 |
[connection master] |
| 10 |
CREATE TABLE t ( f INT) ENGINE=INNODB; |
| 11 |
---- XA PREPARE ---- |
| 12 |
XA START 'xatest'; |
| 13 |
INSERT INTO t VALUES (10); |
| 14 |
XA END 'xatest'; |
| 15 |
XA PREPARE 'xatest'; |
| 16 |
include/sync_slave_sql_with_master.inc |
| 17 |
# Wait for XA_STATE to become PREPARED on slave |
| 18 |
# Expecting one prepared transaction |
| 19 |
XA RECOVER; |
| 20 |
formatID gtrid_length bqual_length data |
| 21 |
1 6 0 xatest |
| 22 |
Waiting until gtid is MASTER_UUID:2 |
| 23 |
---- XA COMMIT ---- |
| 24 |
[connection master] |
| 25 |
XA COMMIT 'xatest'; |
| 26 |
include/sync_slave_sql_with_master.inc |
| 27 |
# Wait for XA_STATE to become COMMITTED on slave |
| 28 |
# Expecting no prepared transactions |
| 29 |
XA RECOVER; |
| 30 |
formatID gtrid_length bqual_length data |
| 31 |
Waiting until gtid is MASTER_UUID:3 |
| 32 |
include/diff_tables.inc [master:t,slave:t] |
| 33 |
[connection master] |
| 34 |
DROP TABLE t; |
| 35 |
include/sync_slave_sql_with_master.inc |
| 36 |
include/rpl_reset.inc |
| 37 |
#################################################################### |
| 38 |
# Test Case 2: Enable Multithreaded Slave with replica_parallel_type as |
| 39 |
# DATABASE. Verify that slave displays appropriate XA_STATE in |
| 40 |
# performance schema table, post XA PREPARE AND XA COMMIT command |
| 41 |
# execution. |
| 42 |
#################################################################### |
| 43 |
[connection slave] |
| 44 |
SET @save_replica_parallel_workers=@@global.replica_parallel_workers; |
| 45 |
SET @replica_parallel_type=@@global.replica_parallel_type; |
| 46 |
include/stop_slave.inc |
| 47 |
SET GLOBAL replica_parallel_workers=4; |
| 48 |
SET GLOBAL replica_parallel_type='DATABASE'; |
| 49 |
include/start_slave.inc |
| 50 |
[connection slave] |
| 51 |
TRUNCATE TABLE performance_schema.events_transactions_current; |
| 52 |
---- Setup ---- |
| 53 |
[connection master] |
| 54 |
CREATE TABLE t ( f INT) ENGINE=INNODB; |
| 55 |
---- XA PREPARE ---- |
| 56 |
XA START 'xatest'; |
| 57 |
INSERT INTO t VALUES (10); |
| 58 |
XA END 'xatest'; |
| 59 |
XA PREPARE 'xatest'; |
| 60 |
include/sync_slave_sql_with_master.inc |
| 61 |
# Wait for XA_STATE to become PREPARED on slave |
| 62 |
# Expecting one prepared transaction |
| 63 |
XA RECOVER; |
| 64 |
formatID gtrid_length bqual_length data |
| 65 |
1 6 0 xatest |
| 66 |
Waiting until gtid is MASTER_UUID:2 |
| 67 |
---- XA COMMIT ---- |
| 68 |
[connection master] |
| 69 |
XA COMMIT 'xatest'; |
| 70 |
include/sync_slave_sql_with_master.inc |
| 71 |
# Wait for XA_STATE to become COMMITTED on slave |
| 72 |
# Expecting no prepared transactions |
| 73 |
XA RECOVER; |
| 74 |
formatID gtrid_length bqual_length data |
| 75 |
Waiting until gtid is MASTER_UUID:3 |
| 76 |
include/diff_tables.inc [master:t,slave:t] |
| 77 |
[connection master] |
| 78 |
DROP TABLE t; |
| 79 |
include/sync_slave_sql_with_master.inc |
| 80 |
include/rpl_reset.inc |
| 81 |
#################################################################### |
| 82 |
# Test Case 3: Enable Multithreaded Slave with replica_parallel_type as |
| 83 |
# LOGICAL_CLOCK. Verify that slave displays appropriate XA_STATE in |
| 84 |
# performance schema table, post XA PREPARE AND XA COMMIT command |
| 85 |
# execution. |
| 86 |
#################################################################### |
| 87 |
include/stop_slave.inc |
| 88 |
SET GLOBAL replica_parallel_workers=4; |
| 89 |
SET GLOBAL replica_parallel_type='LOGICAL_CLOCK'; |
| 90 |
include/start_slave.inc |
| 91 |
[connection slave] |
| 92 |
TRUNCATE TABLE performance_schema.events_transactions_current; |
| 93 |
---- Setup ---- |
| 94 |
[connection master] |
| 95 |
CREATE TABLE t ( f INT) ENGINE=INNODB; |
| 96 |
---- XA PREPARE ---- |
| 97 |
XA START 'xatest'; |
| 98 |
INSERT INTO t VALUES (10); |
| 99 |
XA END 'xatest'; |
| 100 |
XA PREPARE 'xatest'; |
| 101 |
include/sync_slave_sql_with_master.inc |
| 102 |
# Wait for XA_STATE to become PREPARED on slave |
| 103 |
# Expecting one prepared transaction |
| 104 |
XA RECOVER; |
| 105 |
formatID gtrid_length bqual_length data |
| 106 |
1 6 0 xatest |
| 107 |
Waiting until gtid is MASTER_UUID:2 |
| 108 |
---- XA COMMIT ---- |
| 109 |
[connection master] |
| 110 |
XA COMMIT 'xatest'; |
| 111 |
include/sync_slave_sql_with_master.inc |
| 112 |
# Wait for XA_STATE to become COMMITTED on slave |
| 113 |
# Expecting no prepared transactions |
| 114 |
XA RECOVER; |
| 115 |
formatID gtrid_length bqual_length data |
| 116 |
Waiting until gtid is MASTER_UUID:3 |
| 117 |
include/diff_tables.inc [master:t,slave:t] |
| 118 |
[connection master] |
| 119 |
DROP TABLE t; |
| 120 |
include/sync_slave_sql_with_master.inc |
| 121 |
[connection slave] |
| 122 |
include/stop_slave.inc |
| 123 |
set @@global.replica_parallel_workers= @save_replica_parallel_workers; |
| 124 |
set @@global.replica_parallel_type= @replica_parallel_type; |
| 125 |
include/start_slave.inc |
| 126 |
include/rpl_end.inc |