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