| 1 |
connection node_2; |
| 2 |
connection node_1; |
| 3 |
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; |
| 4 |
#Connection 2 |
| 5 |
connection node_2; |
| 6 |
START SLAVE; |
| 7 |
#Connection 3 |
| 8 |
connection node_3; |
| 9 |
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB; |
| 10 |
INSERT INTO t2 VALUES(1,11); |
| 11 |
INSERT INTO t2 VALUES(2,22); |
| 12 |
INSERT INTO t2 VALUES(3,33); |
| 13 |
SELECT @@global.gtid_binlog_state; |
| 14 |
@@global.gtid_binlog_state |
| 15 |
2-3-4 |
| 16 |
include/save_master_gtid.inc |
| 17 |
#Connection 2 |
| 18 |
connection node_2; |
| 19 |
include/sync_with_master_gtid.inc |
| 20 |
SELECT @@global.gtid_binlog_state; |
| 21 |
@@global.gtid_binlog_state |
| 22 |
2-3-4 |
| 23 |
INSERT INTO t2 VALUES(4,44); |
| 24 |
INSERT INTO t2 VALUES(5,55); |
| 25 |
INSERT INTO t2 VALUES(6,66); |
| 26 |
SELECT @@global.gtid_binlog_state; |
| 27 |
@@global.gtid_binlog_state |
| 28 |
1-1-3,2-3-4 |
| 29 |
#Connection 1 |
| 30 |
connection node_1; |
| 31 |
INSERT INTO t2 VALUES(7,77); |
| 32 |
INSERT INTO t2 VALUES(8,88); |
| 33 |
SELECT @@global.gtid_binlog_state; |
| 34 |
@@global.gtid_binlog_state |
| 35 |
1-1-5,2-3-4 |
| 36 |
#Connection 3 |
| 37 |
connection node_3; |
| 38 |
CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; |
| 39 |
SET AUTOCOMMIT=OFF; |
| 40 |
START TRANSACTION; |
| 41 |
INSERT INTO t1 VALUES ('node1_committed_before'); |
| 42 |
INSERT INTO t1 VALUES ('node1_committed_before'); |
| 43 |
COMMIT; |
| 44 |
include/save_master_gtid.inc |
| 45 |
#Connection 2 |
| 46 |
connection node_2; |
| 47 |
include/sync_with_master_gtid.inc |
| 48 |
SET AUTOCOMMIT=OFF; |
| 49 |
START TRANSACTION; |
| 50 |
INSERT INTO t1 VALUES ('node2_committed_before'); |
| 51 |
INSERT INTO t1 VALUES ('node2_committed_before'); |
| 52 |
COMMIT; |
| 53 |
#Connection 1 |
| 54 |
connection node_1; |
| 55 |
connection node_1; |
| 56 |
connection node_2; |
| 57 |
#Connection 2 |
| 58 |
connection node_2; |
| 59 |
Shutting down server ... |
| 60 |
#Connection 1 |
| 61 |
connection node_1; |
| 62 |
SET AUTOCOMMIT=OFF; |
| 63 |
START TRANSACTION; |
| 64 |
INSERT INTO t1 VALUES ('node1_committed_during'); |
| 65 |
INSERT INTO t1 VALUES ('node1_committed_during'); |
| 66 |
COMMIT; |
| 67 |
#Connection 2 |
| 68 |
connection node_2; |
| 69 |
Starting server ... |
| 70 |
SET AUTOCOMMIT=OFF; |
| 71 |
START TRANSACTION; |
| 72 |
INSERT INTO t1 VALUES ('node2_committed_after'); |
| 73 |
INSERT INTO t1 VALUES ('node2_committed_after'); |
| 74 |
COMMIT; |
| 75 |
#Connection 1 |
| 76 |
connection node_1; |
| 77 |
Select * from t1 order by f1; |
| 78 |
f1 |
| 79 |
node1_committed_before |
| 80 |
node1_committed_before |
| 81 |
node1_committed_during |
| 82 |
node1_committed_during |
| 83 |
node2_committed_after |
| 84 |
node2_committed_after |
| 85 |
node2_committed_before |
| 86 |
node2_committed_before |
| 87 |
#Connection 2 |
| 88 |
connection node_2; |
| 89 |
Select * from t1 order by f1; |
| 90 |
f1 |
| 91 |
node1_committed_before |
| 92 |
node1_committed_before |
| 93 |
node1_committed_during |
| 94 |
node1_committed_during |
| 95 |
node2_committed_after |
| 96 |
node2_committed_after |
| 97 |
node2_committed_before |
| 98 |
node2_committed_before |
| 99 |
#Connection 1 |
| 100 |
connection node_1; |
| 101 |
SELECT @@global.gtid_binlog_state; |
| 102 |
@@global.gtid_binlog_state |
| 103 |
1-1-8,2-3-6 |
| 104 |
#Connection 2 |
| 105 |
connection node_2; |
| 106 |
SELECT @@global.gtid_binlog_state; |
| 107 |
@@global.gtid_binlog_state |
| 108 |
1-1-8,2-3-6 |
| 109 |
#Connection 3 |
| 110 |
connection node_3; |
| 111 |
SET AUTOCOMMIT=ON; |
| 112 |
#Connection 2 |
| 113 |
connection node_2; |
| 114 |
SET AUTOCOMMIT=ON; |
| 115 |
#Connection 1 |
| 116 |
connection node_1; |
| 117 |
SET AUTOCOMMIT=ON; |
| 118 |
#Connection 2 |
| 119 |
connection node_2; |
| 120 |
STOP slave; |
| 121 |
INSERT INTO t1 VALUES ('node2_slave_stoped'); |
| 122 |
#Connection 3 |
| 123 |
connection node_3; |
| 124 |
INSERT INTO t1 VALUES ('node3_normal_entry'); |
| 125 |
include/save_master_gtid.inc |
| 126 |
#Connection 2 |
| 127 |
connection node_2; |
| 128 |
INSERT INTO t1 VALUES ('node2_slave_stoped_inserted'); |
| 129 |
start slave; |
| 130 |
include/sync_with_master_gtid.inc |
| 131 |
INSERT INTO t1 VALUES ('node2_slave_started'); |
| 132 |
SELECT count(*) from t1; |
| 133 |
count(*) |
| 134 |
12 |
| 135 |
SELECT @@global.gtid_binlog_state; |
| 136 |
@@global.gtid_binlog_state |
| 137 |
1-1-11,2-3-7 |
| 138 |
#Connection 1 |
| 139 |
connection node_1; |
| 140 |
SELECT count(*) from t1; |
| 141 |
count(*) |
| 142 |
12 |
| 143 |
SELECT @@global.gtid_binlog_state; |
| 144 |
@@global.gtid_binlog_state |
| 145 |
1-1-11,2-3-7 |
| 146 |
#Connection 3 |
| 147 |
connection node_3; |
| 148 |
DROP TABLE t2,t1; |
| 149 |
#Connection 2 |
| 150 |
connection node_2; |
| 151 |
#Connection 1 |
| 152 |
connection node_1; |
| 153 |
#Connection 2 |
| 154 |
connection node_2; |
| 155 |
STOP SLAVE; |
| 156 |
RESET SLAVE ALL; |
| 157 |
set global wsrep_on=OFF; |
| 158 |
reset master; |
| 159 |
set global wsrep_on=ON; |
| 160 |
set global gtid_slave_pos=""; |
| 161 |
#Connection 1 |
| 162 |
connection node_1; |
| 163 |
set global wsrep_on=OFF; |
| 164 |
reset master; |
| 165 |
set global wsrep_on=ON; |
| 166 |
#Connection 3 |
| 167 |
connection node_3; |
| 168 |
reset master; |
| 169 |
connection node_2; |
| 170 |
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node"); |