| 1 |
connection node_2; |
| 2 |
connection node_1; |
| 3 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); |
| 4 |
INSERT INTO t1 VALUES (1, 'a'); |
| 5 |
INSERT INTO t1 VALUES (2, 'a'); |
| 6 |
connection node_1; |
| 7 |
SET AUTOCOMMIT=ON; |
| 8 |
START TRANSACTION; |
| 9 |
UPDATE t1 SET f2 = 'b' WHERE f1 = 1; |
| 10 |
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; |
| 11 |
f1 f2 |
| 12 |
2 a |
| 13 |
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
| 14 |
SET SESSION wsrep_sync_wait=0; |
| 15 |
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; |
| 16 |
connection node_2; |
| 17 |
UPDATE t1 SET f2 = 'c' WHERE f1 = 2; |
| 18 |
connection node_1a; |
| 19 |
SET SESSION wsrep_on = 0; |
| 20 |
SET SESSION wsrep_on = 1; |
| 21 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 22 |
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; |
| 23 |
connection node_1; |
| 24 |
COMMIT; |
| 25 |
connection node_1a; |
| 26 |
SET SESSION wsrep_on = 0; |
| 27 |
SET SESSION wsrep_on = 1; |
| 28 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 29 |
SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; |
| 30 |
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; |
| 31 |
SET SESSION wsrep_on = 0; |
| 32 |
SET SESSION wsrep_on = 1; |
| 33 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 34 |
SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; |
| 35 |
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; |
| 36 |
connection node_1; |
| 37 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; |
| 38 |
COUNT(*) = 1 |
| 39 |
1 |
| 40 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; |
| 41 |
COUNT(*) = 1 |
| 42 |
1 |
| 43 |
wsrep_local_replays |
| 44 |
1 |
| 45 |
connection node_2; |
| 46 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; |
| 47 |
COUNT(*) = 1 |
| 48 |
1 |
| 49 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; |
| 50 |
COUNT(*) = 1 |
| 51 |
1 |
| 52 |
DROP TABLE t1; |
| 53 |
connection node_1; |
| 54 |
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); |
| 55 |
INSERT INTO t1 VALUES (1, 'a'); |
| 56 |
INSERT INTO t1 VALUES (2, 'a'); |
| 57 |
connection node_1; |
| 58 |
SET AUTOCOMMIT=ON; |
| 59 |
START TRANSACTION; |
| 60 |
UPDATE t1 SET f2 = 'b' WHERE f1 = 1; |
| 61 |
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; |
| 62 |
f1 f2 |
| 63 |
2 a |
| 64 |
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; |
| 65 |
connection node_1; |
| 66 |
COMMIT; |
| 67 |
connection node_1a; |
| 68 |
SET SESSION wsrep_on = 0; |
| 69 |
SET SESSION wsrep_on = 1; |
| 70 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 71 |
SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; |
| 72 |
connection node_2; |
| 73 |
UPDATE t1 SET f2 = 'c' WHERE f1 = 2; |
| 74 |
connection node_1a; |
| 75 |
SET SESSION wsrep_on = 0; |
| 76 |
SET SESSION wsrep_on = 1; |
| 77 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 78 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 79 |
SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; |
| 80 |
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; |
| 81 |
connection node_1; |
| 82 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; |
| 83 |
COUNT(*) = 1 |
| 84 |
1 |
| 85 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; |
| 86 |
COUNT(*) = 1 |
| 87 |
1 |
| 88 |
wsrep_local_replays |
| 89 |
1 |
| 90 |
connection node_2; |
| 91 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; |
| 92 |
COUNT(*) = 1 |
| 93 |
1 |
| 94 |
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; |
| 95 |
COUNT(*) = 1 |
| 96 |
1 |
| 97 |
DROP TABLE t1; |
| 98 |
connection node_1; |
| 99 |
CREATE TABLE t1 (i int primary key, j int) ENGINE=INNODB; |
| 100 |
INSERT INTO t1 VALUES (1, 0), (3, 0); |
| 101 |
SELECT * FROM t1; |
| 102 |
i j |
| 103 |
1 0 |
| 104 |
3 0 |
| 105 |
SET AUTOCOMMIT=ON; |
| 106 |
PREPARE stmt1 FROM "UPDATE t1 SET j = 1 where i > 0"; |
| 107 |
connection node_1a; |
| 108 |
SET SESSION wsrep_sync_wait=0; |
| 109 |
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; |
| 110 |
connection node_2; |
| 111 |
INSERT INTO t1 VALUES(2,2); |
| 112 |
connection node_1a; |
| 113 |
SET SESSION wsrep_on = 0; |
| 114 |
SET SESSION wsrep_on = 1; |
| 115 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 116 |
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; |
| 117 |
connection node_1; |
| 118 |
SET SESSION wsrep_sync_wait=0; |
| 119 |
EXECUTE stmt1; |
| 120 |
connection node_1a; |
| 121 |
SET SESSION wsrep_on = 0; |
| 122 |
SET SESSION wsrep_on = 1; |
| 123 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 124 |
SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; |
| 125 |
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; |
| 126 |
SET SESSION wsrep_on = 0; |
| 127 |
SET SESSION wsrep_on = 1; |
| 128 |
SET GLOBAL wsrep_provider_options = 'dbug='; |
| 129 |
SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; |
| 130 |
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; |
| 131 |
connection node_1; |
| 132 |
SET SESSION wsrep_sync_wait=7; |
| 133 |
SELECT * FROM t1; |
| 134 |
i j |
| 135 |
1 1 |
| 136 |
2 2 |
| 137 |
3 1 |
| 138 |
connection node_2; |
| 139 |
SELECT * FROM t1; |
| 140 |
i j |
| 141 |
1 1 |
| 142 |
2 2 |
| 143 |
3 1 |
| 144 |
connection node_1; |
| 145 |
wsrep_local_replays |
| 146 |
1 |
| 147 |
DEALLOCATE PREPARE stmt1; |
| 148 |
DROP TABLE t1; |