| 1 |
# |
| 2 |
# MDEV-24327 wsrep XID checkpointing order violation with log_slave_updates=OFF |
| 3 |
# |
| 4 |
# Here we have configure two node cluster with --log-bin=ON and --log-slave_-updates=OFF |
| 5 |
# |
| 6 |
# a transaction in node executes so far that it has replicated and reached |
| 7 |
# commit phase, We have sync point before entering commit order monitor and |
| 8 |
# the transaction is parked there |
| 9 |
# |
| 10 |
# Then another transaction is executed in node 2, it replicates and commits in node 2 |
| 11 |
# and is received and applied in node 1. After applying it will remain waiting for |
| 12 |
# commit order monitor, as it has later seqno than the first transaction in node 1. |
| 13 |
# |
| 14 |
# control connection in node 1 waits to see the |
| 15 |
# |
| 16 |
# With the buggy version of MDEV-24327, the applier has however, already synced the |
| 17 |
# wsrep XID checkpoint |
| 18 |
# |
| 19 |
# |
| 20 |
# |
| 21 |
|
| 22 |
--source include/galera_cluster.inc |
| 23 |
--source include/have_innodb.inc |
| 24 |
--source include/have_debug_sync.inc |
| 25 |
--source include/galera_have_debug_sync.inc |
| 26 |
|
| 27 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); |
| 28 |
INSERT INTO t1 VALUES (1, 'f'); |
| 29 |
INSERT INTO t1 VALUES (2, 'g'); |
| 30 |
|
| 31 |
--connection node_1 |
| 32 |
SET AUTOCOMMIT=ON; |
| 33 |
START TRANSACTION; |
| 34 |
|
| 35 |
UPDATE t1 SET f2 = '1' WHERE f1 = 1; |
| 36 |
|
| 37 |
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
| 38 |
SET SESSION wsrep_sync_wait=0; |
| 39 |
--connection node_1a |
| 40 |
--let $expected_wsrep_received = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received'` |
| 41 |
--source include/galera_wait_sync_point.inc |
| 42 |
--source include/galera_clear_sync_point.inc |
| 43 |
|
| 44 |
# Block the commit, send the COMMIT and wait until it gets blocked |
| 45 |
|
| 46 |
--let $galera_sync_point = commit_monitor_master_enter_sync |
| 47 |
--source include/galera_set_sync_point.inc |
| 48 |
|
| 49 |
--connection node_1 |
| 50 |
--send COMMIT |
| 51 |
|
| 52 |
--connection node_1a |
| 53 |
|
| 54 |
# wait for the commit to block in sync point |
| 55 |
|
| 56 |
--let $galera_sync_point = commit_monitor_master_enter_sync |
| 57 |
--source include/galera_wait_sync_point.inc |
| 58 |
--source include/galera_clear_sync_point.inc |
| 59 |
|
| 60 |
# |
| 61 |
# replicate non conflicting transaction from node 2 |
| 62 |
# it will get later seqno and should sync XID checkpoint after transaction in node 1 |
| 63 |
# |
| 64 |
--connection node_2 |
| 65 |
UPDATE t1 SET f2 = '2' WHERE f1 = 2; |
| 66 |
|
| 67 |
# |
| 68 |
# wait until update from node 2 has been committed |
| 69 |
# if XID checkpointing order was violated, node 1 would crash for assert |
| 70 |
# |
| 71 |
|
| 72 |
--connection node_1a |
| 73 |
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_wsrep_received FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received' |
| 74 |
--source include/wait_condition.inc |
| 75 |
|
| 76 |
--let $galera_sync_point = commit_monitor_master_enter_sync |
| 77 |
--source include/galera_signal_sync_point.inc |
| 78 |
--source include/galera_clear_sync_point.inc |
| 79 |
|
| 80 |
--connection node_1 |
| 81 |
--reap |
| 82 |
SELECT * FROM t1; |
| 83 |
--echo "node 1 is complete now" |
| 84 |
|
| 85 |
|
| 86 |
--connection node_2 |
| 87 |
DROP TABLE t1; |