Browse Source
MDEV-34891 : SST failure occurs when gtid_strict_mode is enabled
MDEV-34891 : SST failure occurs when gtid_strict_mode is enabled
Problem was that initial GTID was set on wsrep_before_prepare out-of-order. In practice GTID was set to same as previous executed transaction GTID. In recovery valid GTID was found from prepared transaction and this transaction is committed leading to fact that same GTID was executed twice. This is fixed by setting invalid GTID at wsrep_before_prepare and later in wsrep_before_commit actual correct GTID is set and this setting is done while we are in commit monitor i.e. assigment is done in order of replication. In recovery if prepared transaction is found we check its GTID, if it is invalid transaction will be rolled back and if it is valid it will be committed. Initialize gtid seqno from recovered seqno when bootstrapping a new cluster. Added two test cases for both mariabackup and rsync SST methods to show that GTIDs remain consistent on cluster and that all expected rows are in the table. Added tests for wsrep GTID recovery with binlog on and off. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>pull/3114/head
committed by
Julius Goryavsky
23 changed files with 1853 additions and 26 deletions
-
210mysql-test/suite/galera/r/galera_sst_mariabackup_gtid,debug.rdiff
-
534mysql-test/suite/galera/r/galera_sst_mariabackup_gtid.result
-
210mysql-test/suite/galera/r/galera_sst_rsync_gtid,debug.rdiff
-
534mysql-test/suite/galera/r/galera_sst_rsync_gtid.result
-
2mysql-test/suite/galera/suite.pm
-
28mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.cnf
-
29mysql-test/suite/galera/t/galera_sst_mariabackup_gtid.test
-
23mysql-test/suite/galera/t/galera_sst_rsync_gtid.cnf
-
29mysql-test/suite/galera/t/galera_sst_rsync_gtid.test
-
2mysql-test/suite/galera_3nodes/suite.pm
-
2mysql-test/suite/galera_3nodes_sr/suite.pm
-
2mysql-test/suite/galera_sr/suite.pm
-
18mysql-test/suite/wsrep/r/wsrep-recover-gtid-nobinlog.result
-
65mysql-test/suite/wsrep/r/wsrep-recover-gtid.result
-
10mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.cnf
-
28mysql-test/suite/wsrep/t/wsrep-recover-gtid-nobinlog.test
-
14mysql-test/suite/wsrep/t/wsrep-recover-gtid.cnf
-
73mysql-test/suite/wsrep/t/wsrep-recover-gtid.test
-
1sql/handler.cc
-
3sql/wsrep_mysqld.cc
-
15sql/wsrep_trans_observer.h
-
43sql/wsrep_xid.cc
-
4sql/wsrep_xid.h
@ -0,0 +1,210 @@ |
|||
--- suite/galera/r/galera_sst_mariabackup_gtid.result 2025-01-02 15:34:28.251593452 +0200 |
|||
+++ suite/galera/r/galera_sst_mariabackup_gtid.reject 2025-01-02 16:01:18.058469177 +0200 |
|||
@@ -516,19 +516,203 @@ |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
+Performing State Transfer on a server that has been killed and restarted |
|||
+while a DDL was in progress on it |
|||
+connection node_1; |
|||
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
+connection node_2; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
+COMMIT; |
|||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; |
|||
+connection node_1; |
|||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
|||
+connection node_2; |
|||
+SET wsrep_sync_wait = 0; |
|||
+Killing server ... |
|||
+connection node_1; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); |
|||
+COMMIT; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); |
|||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); |
|||
+connection node_2; |
|||
+Performing --wsrep-recover ... |
|||
+connection node_2; |
|||
+Starting server ... |
|||
+Using --wsrep-start-position when starting mysqld ... |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); |
|||
+COMMIT; |
|||
+connection node_1; |
|||
+INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); |
|||
+COMMIT; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); |
|||
+COMMIT; |
|||
+connection node_1a_galera_st_kill_slave_ddl; |
|||
+INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); |
|||
+ROLLBACK; |
|||
+SET AUTOCOMMIT=ON; |
|||
+SET SESSION wsrep_sync_wait=15; |
|||
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
+EXPECT_3 |
|||
+3 |
|||
+SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
+EXPECT_35 |
|||
+35 |
|||
+SELECT * FROM t1; |
|||
+id f1 f2 |
|||
+1 node1_committed_before NULL |
|||
+2 node1_committed_before NULL |
|||
+3 node1_committed_before NULL |
|||
+4 node1_committed_before NULL |
|||
+5 node1_committed_before NULL |
|||
+6 node2_committed_before NULL |
|||
+7 node2_committed_before NULL |
|||
+8 node2_committed_before NULL |
|||
+9 node2_committed_before NULL |
|||
+10 node2_committed_before NULL |
|||
+11 node1_committed_during NULL |
|||
+12 node1_committed_during NULL |
|||
+13 node1_committed_during NULL |
|||
+14 node1_committed_during NULL |
|||
+15 node1_committed_during NULL |
|||
+16 node1_to_be_committed_after NULL |
|||
+17 node1_to_be_committed_after NULL |
|||
+18 node1_to_be_committed_after NULL |
|||
+19 node1_to_be_committed_after NULL |
|||
+20 node1_to_be_committed_after NULL |
|||
+26 node2_committed_after NULL |
|||
+27 node2_committed_after NULL |
|||
+28 node2_committed_after NULL |
|||
+29 node2_committed_after NULL |
|||
+30 node2_committed_after NULL |
|||
+31 node1_to_be_committed_after NULL |
|||
+32 node1_to_be_committed_after NULL |
|||
+33 node1_to_be_committed_after NULL |
|||
+34 node1_to_be_committed_after NULL |
|||
+35 node1_to_be_committed_after NULL |
|||
+36 node1_committed_after NULL |
|||
+37 node1_committed_after NULL |
|||
+38 node1_committed_after NULL |
|||
+39 node1_committed_after NULL |
|||
+40 node1_committed_after NULL |
|||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
+COUNT(*) = 0 |
|||
+1 |
|||
+COMMIT; |
|||
+connection node_1; |
|||
+SET AUTOCOMMIT=ON; |
|||
+SET SESSION wsrep_sync_wait=15; |
|||
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
+EXPECT_3 |
|||
+3 |
|||
+SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
+EXPECT_35 |
|||
+35 |
|||
+SELECT * FROM t1; |
|||
+id f1 f2 |
|||
+1 node1_committed_before NULL |
|||
+2 node1_committed_before NULL |
|||
+3 node1_committed_before NULL |
|||
+4 node1_committed_before NULL |
|||
+5 node1_committed_before NULL |
|||
+6 node2_committed_before NULL |
|||
+7 node2_committed_before NULL |
|||
+8 node2_committed_before NULL |
|||
+9 node2_committed_before NULL |
|||
+10 node2_committed_before NULL |
|||
+11 node1_committed_during NULL |
|||
+12 node1_committed_during NULL |
|||
+13 node1_committed_during NULL |
|||
+14 node1_committed_during NULL |
|||
+15 node1_committed_during NULL |
|||
+16 node1_to_be_committed_after NULL |
|||
+17 node1_to_be_committed_after NULL |
|||
+18 node1_to_be_committed_after NULL |
|||
+19 node1_to_be_committed_after NULL |
|||
+20 node1_to_be_committed_after NULL |
|||
+26 node2_committed_after NULL |
|||
+27 node2_committed_after NULL |
|||
+28 node2_committed_after NULL |
|||
+29 node2_committed_after NULL |
|||
+30 node2_committed_after NULL |
|||
+31 node1_to_be_committed_after NULL |
|||
+32 node1_to_be_committed_after NULL |
|||
+33 node1_to_be_committed_after NULL |
|||
+34 node1_to_be_committed_after NULL |
|||
+35 node1_to_be_committed_after NULL |
|||
+36 node1_committed_after NULL |
|||
+37 node1_committed_after NULL |
|||
+38 node1_committed_after NULL |
|||
+39 node1_committed_after NULL |
|||
+40 node1_committed_after NULL |
|||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
+COUNT(*) = 0 |
|||
+1 |
|||
+DROP TABLE t1; |
|||
+COMMIT; |
|||
+SET GLOBAL debug_dbug = $debug_orig; |
|||
connection node_1; |
|||
# Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
-gtid_binlog_pos 100-10-24 |
|||
-gtid_current_pos 100-10-24 |
|||
+gtid_binlog_pos 100-10-33 |
|||
+gtid_current_pos 100-10-33 |
|||
gtid_slave_pos |
|||
connection node_2; |
|||
# Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
-gtid_binlog_pos 100-10-24 |
|||
-gtid_current_pos 100-10-24 |
|||
+gtid_binlog_pos 100-10-33 |
|||
+gtid_current_pos 100-10-33 |
|||
gtid_slave_pos |
|||
disconnect node_2; |
|||
disconnect node_1; |
@ -0,0 +1,534 @@ |
|||
connection node_2; |
|||
connection node_1; |
|||
connection node_1; |
|||
connection node_2; |
|||
Performing State Transfer on a server that has been shut down cleanly and restarted |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Shutting down server ... |
|||
connection node_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Starting server ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_shutdown_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
|||
EXPECT_15 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
|||
EXPECT_15 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
Performing State Transfer on a server that starts from a clean var directory |
|||
This is accomplished by shutting down node #2 and removing its var directory before restarting it |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Shutting down server ... |
|||
connection node_1; |
|||
Cleaning var directory ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Starting server ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_clean_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
Performing State Transfer on a server that has been killed and restarted |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Killing server ... |
|||
connection node_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Performing --wsrep-recover ... |
|||
Starting server ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_kill_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * FROM t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * FROM t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
connection node_1; |
|||
# Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
gtid_binlog_pos 100-10-24 |
|||
gtid_current_pos 100-10-24 |
|||
gtid_slave_pos |
|||
connection node_2; |
|||
# Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
gtid_binlog_pos 100-10-24 |
|||
gtid_current_pos 100-10-24 |
|||
gtid_slave_pos |
|||
disconnect node_2; |
|||
disconnect node_1; |
@ -0,0 +1,210 @@ |
|||
--- suite/galera/r/galera_sst_rsync_gtid.result 2025-01-02 15:35:15.162175835 +0200 |
|||
+++ suite/galera/r/galera_sst_rsync_gtid.reject 2025-01-02 16:02:08.588902711 +0200 |
|||
@@ -516,19 +516,203 @@ |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
+Performing State Transfer on a server that has been killed and restarted |
|||
+while a DDL was in progress on it |
|||
+connection node_1; |
|||
+CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
+INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
+connection node_2; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
+INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
+COMMIT; |
|||
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; |
|||
+connection node_1; |
|||
+ALTER TABLE t1 ADD COLUMN f2 INTEGER; |
|||
+connection node_2; |
|||
+SET wsrep_sync_wait = 0; |
|||
+Killing server ... |
|||
+connection node_1; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (11,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (12,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (13,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (14,'node1_committed_during'); |
|||
+INSERT INTO t1 (id,f1) VALUES (15,'node1_committed_during'); |
|||
+COMMIT; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (16,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (17,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (18,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (19,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (20,'node1_to_be_committed_after'); |
|||
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (21,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (22,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (23,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (24,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (25,'node1_to_be_rollbacked_after'); |
|||
+connection node_2; |
|||
+Performing --wsrep-recover ... |
|||
+connection node_2; |
|||
+Starting server ... |
|||
+Using --wsrep-start-position when starting mysqld ... |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (26,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (27,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (28,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (29,'node2_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (30,'node2_committed_after'); |
|||
+COMMIT; |
|||
+connection node_1; |
|||
+INSERT INTO t1 (id,f1) VALUES (31,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (32,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (33,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (34,'node1_to_be_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (35,'node1_to_be_committed_after'); |
|||
+COMMIT; |
|||
+SET AUTOCOMMIT=OFF; |
|||
+START TRANSACTION; |
|||
+INSERT INTO t1 (id,f1) VALUES (36,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (37,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (38,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (39,'node1_committed_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (40,'node1_committed_after'); |
|||
+COMMIT; |
|||
+connection node_1a_galera_st_kill_slave_ddl; |
|||
+INSERT INTO t1 (id,f1) VALUES (41,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (42,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (43,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (44,'node1_to_be_rollbacked_after'); |
|||
+INSERT INTO t1 (id,f1) VALUES (45,'node1_to_be_rollbacked_after'); |
|||
+ROLLBACK; |
|||
+SET AUTOCOMMIT=ON; |
|||
+SET SESSION wsrep_sync_wait=15; |
|||
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
+EXPECT_3 |
|||
+3 |
|||
+SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
+EXPECT_35 |
|||
+35 |
|||
+SELECT * FROM t1; |
|||
+id f1 f2 |
|||
+1 node1_committed_before NULL |
|||
+2 node1_committed_before NULL |
|||
+3 node1_committed_before NULL |
|||
+4 node1_committed_before NULL |
|||
+5 node1_committed_before NULL |
|||
+6 node2_committed_before NULL |
|||
+7 node2_committed_before NULL |
|||
+8 node2_committed_before NULL |
|||
+9 node2_committed_before NULL |
|||
+10 node2_committed_before NULL |
|||
+11 node1_committed_during NULL |
|||
+12 node1_committed_during NULL |
|||
+13 node1_committed_during NULL |
|||
+14 node1_committed_during NULL |
|||
+15 node1_committed_during NULL |
|||
+16 node1_to_be_committed_after NULL |
|||
+17 node1_to_be_committed_after NULL |
|||
+18 node1_to_be_committed_after NULL |
|||
+19 node1_to_be_committed_after NULL |
|||
+20 node1_to_be_committed_after NULL |
|||
+26 node2_committed_after NULL |
|||
+27 node2_committed_after NULL |
|||
+28 node2_committed_after NULL |
|||
+29 node2_committed_after NULL |
|||
+30 node2_committed_after NULL |
|||
+31 node1_to_be_committed_after NULL |
|||
+32 node1_to_be_committed_after NULL |
|||
+33 node1_to_be_committed_after NULL |
|||
+34 node1_to_be_committed_after NULL |
|||
+35 node1_to_be_committed_after NULL |
|||
+36 node1_committed_after NULL |
|||
+37 node1_committed_after NULL |
|||
+38 node1_committed_after NULL |
|||
+39 node1_committed_after NULL |
|||
+40 node1_committed_after NULL |
|||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
+COUNT(*) = 0 |
|||
+1 |
|||
+COMMIT; |
|||
+connection node_1; |
|||
+SET AUTOCOMMIT=ON; |
|||
+SET SESSION wsrep_sync_wait=15; |
|||
+SELECT COUNT(*) AS EXPECT_3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; |
|||
+EXPECT_3 |
|||
+3 |
|||
+SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
+EXPECT_35 |
|||
+35 |
|||
+SELECT * FROM t1; |
|||
+id f1 f2 |
|||
+1 node1_committed_before NULL |
|||
+2 node1_committed_before NULL |
|||
+3 node1_committed_before NULL |
|||
+4 node1_committed_before NULL |
|||
+5 node1_committed_before NULL |
|||
+6 node2_committed_before NULL |
|||
+7 node2_committed_before NULL |
|||
+8 node2_committed_before NULL |
|||
+9 node2_committed_before NULL |
|||
+10 node2_committed_before NULL |
|||
+11 node1_committed_during NULL |
|||
+12 node1_committed_during NULL |
|||
+13 node1_committed_during NULL |
|||
+14 node1_committed_during NULL |
|||
+15 node1_committed_during NULL |
|||
+16 node1_to_be_committed_after NULL |
|||
+17 node1_to_be_committed_after NULL |
|||
+18 node1_to_be_committed_after NULL |
|||
+19 node1_to_be_committed_after NULL |
|||
+20 node1_to_be_committed_after NULL |
|||
+26 node2_committed_after NULL |
|||
+27 node2_committed_after NULL |
|||
+28 node2_committed_after NULL |
|||
+29 node2_committed_after NULL |
|||
+30 node2_committed_after NULL |
|||
+31 node1_to_be_committed_after NULL |
|||
+32 node1_to_be_committed_after NULL |
|||
+33 node1_to_be_committed_after NULL |
|||
+34 node1_to_be_committed_after NULL |
|||
+35 node1_to_be_committed_after NULL |
|||
+36 node1_committed_after NULL |
|||
+37 node1_committed_after NULL |
|||
+38 node1_committed_after NULL |
|||
+39 node1_committed_after NULL |
|||
+40 node1_committed_after NULL |
|||
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
+COUNT(*) = 0 |
|||
+1 |
|||
+DROP TABLE t1; |
|||
+COMMIT; |
|||
+SET GLOBAL debug_dbug = $debug_orig; |
|||
connection node_1; |
|||
# Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
-gtid_binlog_pos 100-10-24 |
|||
-gtid_current_pos 100-10-24 |
|||
+gtid_binlog_pos 100-10-33 |
|||
+gtid_current_pos 100-10-33 |
|||
gtid_slave_pos |
|||
connection node_2; |
|||
# Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
-gtid_binlog_pos 100-10-24 |
|||
-gtid_current_pos 100-10-24 |
|||
+gtid_binlog_pos 100-10-33 |
|||
+gtid_current_pos 100-10-33 |
|||
gtid_slave_pos |
|||
disconnect node_2; |
|||
disconnect node_1; |
@ -0,0 +1,534 @@ |
|||
connection node_2; |
|||
connection node_1; |
|||
connection node_1; |
|||
connection node_2; |
|||
Performing State Transfer on a server that has been shut down cleanly and restarted |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Shutting down server ... |
|||
connection node_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Starting server ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_shutdown_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
|||
EXPECT_15 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_15 FROM t1; |
|||
EXPECT_15 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
Performing State Transfer on a server that starts from a clean var directory |
|||
This is accomplished by shutting down node #2 and removing its var directory before restarting it |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Shutting down server ... |
|||
connection node_1; |
|||
Cleaning var directory ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Starting server ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_clean_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (44,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * from t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
Performing State Transfer on a server that has been killed and restarted |
|||
connection node_1; |
|||
CREATE TABLE t1 (id int not null primary key,f1 CHAR(255)) ENGINE=InnoDB; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (1,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (2,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (3,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (4,'node1_committed_before'); |
|||
INSERT INTO t1 VALUES (5,'node1_committed_before'); |
|||
COMMIT; |
|||
connection node_2; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (6,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (7,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (8,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (9,'node2_committed_before'); |
|||
INSERT INTO t1 VALUES (10,'node2_committed_before'); |
|||
COMMIT; |
|||
Killing server ... |
|||
connection node_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (11,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (12,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (13,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (14,'node1_committed_during'); |
|||
INSERT INTO t1 VALUES (15,'node1_committed_during'); |
|||
COMMIT; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (16,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (17,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (18,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (19,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (20,'node1_to_be_committed_after'); |
|||
connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (21,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (22,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (23,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (24,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (25,'node1_to_be_rollbacked_after'); |
|||
connection node_2; |
|||
Performing --wsrep-recover ... |
|||
Starting server ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (26,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (27,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (28,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (29,'node2_committed_after'); |
|||
INSERT INTO t1 VALUES (30,'node2_committed_after'); |
|||
COMMIT; |
|||
connection node_1; |
|||
INSERT INTO t1 VALUES (31,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (32,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (33,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (34,'node1_to_be_committed_after'); |
|||
INSERT INTO t1 VALUES (35,'node1_to_be_committed_after'); |
|||
COMMIT; |
|||
SET AUTOCOMMIT=OFF; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (36,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (37,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (38,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (39,'node1_committed_after'); |
|||
INSERT INTO t1 VALUES (40,'node1_committed_after'); |
|||
COMMIT; |
|||
connection node_1a_galera_st_kill_slave; |
|||
INSERT INTO t1 VALUES (41,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (42,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (43,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (45,'node1_to_be_rollbacked_after'); |
|||
INSERT INTO t1 VALUES (46,'node1_to_be_rollbacked_after'); |
|||
ROLLBACK; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * FROM t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
COMMIT; |
|||
connection node_1; |
|||
SET AUTOCOMMIT=ON; |
|||
SET SESSION wsrep_sync_wait=15; |
|||
SELECT COUNT(*) AS EXPECT_35 FROM t1; |
|||
EXPECT_35 |
|||
35 |
|||
SELECT * FROM t1; |
|||
id f1 |
|||
1 node1_committed_before |
|||
2 node1_committed_before |
|||
3 node1_committed_before |
|||
4 node1_committed_before |
|||
5 node1_committed_before |
|||
6 node2_committed_before |
|||
7 node2_committed_before |
|||
8 node2_committed_before |
|||
9 node2_committed_before |
|||
10 node2_committed_before |
|||
11 node1_committed_during |
|||
12 node1_committed_during |
|||
13 node1_committed_during |
|||
14 node1_committed_during |
|||
15 node1_committed_during |
|||
16 node1_to_be_committed_after |
|||
17 node1_to_be_committed_after |
|||
18 node1_to_be_committed_after |
|||
19 node1_to_be_committed_after |
|||
20 node1_to_be_committed_after |
|||
26 node2_committed_after |
|||
27 node2_committed_after |
|||
28 node2_committed_after |
|||
29 node2_committed_after |
|||
30 node2_committed_after |
|||
31 node1_to_be_committed_after |
|||
32 node1_to_be_committed_after |
|||
33 node1_to_be_committed_after |
|||
34 node1_to_be_committed_after |
|||
35 node1_to_be_committed_after |
|||
36 node1_committed_after |
|||
37 node1_committed_after |
|||
38 node1_committed_after |
|||
39 node1_committed_after |
|||
40 node1_committed_after |
|||
SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; |
|||
COUNT(*) = 0 |
|||
1 |
|||
DROP TABLE t1; |
|||
COMMIT; |
|||
connection node_1; |
|||
# Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
gtid_binlog_pos 100-10-24 |
|||
gtid_current_pos 100-10-24 |
|||
gtid_slave_pos |
|||
connection node_2; |
|||
# Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
Variable_name Value |
|||
gtid_binlog_pos 100-10-24 |
|||
gtid_current_pos 100-10-24 |
|||
gtid_slave_pos |
|||
disconnect node_2; |
|||
disconnect node_1; |
@ -0,0 +1,28 @@ |
|||
!include ../galera_2nodes.cnf |
|||
|
|||
[mysqld] |
|||
wsrep_sst_method=mariabackup |
|||
wsrep_sst_auth="root:" |
|||
gtid_strict_mode=ON |
|||
wsrep-gtid_mode=ON |
|||
log-bin |
|||
log-slave_updates |
|||
loose-galera-sst-mariabackup-gtid=1 |
|||
|
|||
[mysqld.1] |
|||
wsrep_provider_options='pc.weight=2;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' |
|||
gtid_domain_id=10 |
|||
wsrep_gtid_domain_id=100 |
|||
wsrep_slave_threads=4 |
|||
server-id=10 |
|||
|
|||
[mysqld.2] |
|||
wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' |
|||
gtid_domain_id=10 |
|||
wsrep_gtid_domain_id=100 |
|||
wsrep_slave_threads=4 |
|||
server-id=10 |
|||
|
|||
[sst] |
|||
transferfmt=@ENV.MTR_GALERA_TFMT |
|||
streamfmt=mbstream |
@ -0,0 +1,29 @@ |
|||
--source include/big_test.inc |
|||
--source include/galera_cluster.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_mariabackup.inc |
|||
--source include/force_restart.inc |
|||
|
|||
# Save original auto_increment_offset values. |
|||
--let $node_1=node_1 |
|||
--let $node_2=node_2 |
|||
--source include/auto_increment_offset_save.inc |
|||
|
|||
--source suite/galera/include/galera_st_shutdown_slave.inc |
|||
--source suite/galera/include/galera_st_clean_slave.inc |
|||
|
|||
--source suite/galera/include/galera_st_kill_slave.inc |
|||
--source suite/galera/include/galera_st_kill_slave_ddl.inc |
|||
|
|||
# Restore original auto_increment_offset values. |
|||
--source include/auto_increment_offset_restore.inc |
|||
|
|||
--connection node_1 |
|||
--echo # Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
|
|||
--connection node_2 |
|||
--echo # Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
|
|||
--source include/galera_end.inc |
@ -0,0 +1,23 @@ |
|||
!include ../galera_2nodes.cnf |
|||
|
|||
[mysqld] |
|||
wsrep_sst_method=rsync |
|||
gtid_strict_mode=ON |
|||
wsrep-gtid_mode=ON |
|||
log-bin |
|||
log-slave_updates |
|||
loose-galera-sst-rsync-gtid=1 |
|||
|
|||
[mysqld.1] |
|||
wsrep_provider_options='pc.weight=2;pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' |
|||
gtid_domain_id=10 |
|||
wsrep_gtid_domain_id=100 |
|||
wsrep_slave_threads=4 |
|||
server-id=10 |
|||
|
|||
[mysqld.2] |
|||
wsrep_provider_options='pc.ignore_sb=true;repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.wait_prim_timeout=PT60S;gcache.size=10M' |
|||
gtid_domain_id=10 |
|||
wsrep_gtid_domain_id=100 |
|||
wsrep_slave_threads=4 |
|||
server-id=10 |
@ -0,0 +1,29 @@ |
|||
--source include/big_test.inc |
|||
--source include/galera_cluster.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_mariabackup.inc |
|||
--source include/force_restart.inc |
|||
|
|||
# Save original auto_increment_offset values. |
|||
--let $node_1=node_1 |
|||
--let $node_2=node_2 |
|||
--source include/auto_increment_offset_save.inc |
|||
|
|||
--source suite/galera/include/galera_st_shutdown_slave.inc |
|||
--source suite/galera/include/galera_st_clean_slave.inc |
|||
|
|||
--source suite/galera/include/galera_st_kill_slave.inc |
|||
--source suite/galera/include/galera_st_kill_slave_ddl.inc |
|||
|
|||
# Restore original auto_increment_offset values. |
|||
--source include/auto_increment_offset_restore.inc |
|||
|
|||
--connection node_1 |
|||
--echo # Node_1 |
|||
SHOW global variables like 'gtid%pos'; |
|||
|
|||
--connection node_2 |
|||
--echo # Node_2 |
|||
SHOW global variables like 'gtid%pos'; |
|||
|
|||
--source include/galera_end.inc |
@ -0,0 +1,18 @@ |
|||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
|||
# Case 1: Server goes through graceful shutdown and is restarted |
|||
connection default; |
|||
INSERT INTO t1 VALUES (1); |
|||
Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
WSREP_LAST_SEEN_GTID() |
|||
100-10-2 |
|||
Performing --wsrep-recover ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
WSREP_LAST_SEEN_GTID() |
|||
100-10-2 |
|||
SELECT * FROM t1; |
|||
f1 |
|||
1 |
|||
DROP TABLE t1; |
@ -0,0 +1,65 @@ |
|||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
|||
# Case 1: Server goes through graceful shutdown and is restarted |
|||
connection default; |
|||
INSERT INTO t1 VALUES (1); |
|||
Performing --wsrep-recover ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
WSREP_LAST_SEEN_GTID() |
|||
100-10-2 |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
@@GLOBAL.gtid_binlog_pos |
|||
100-10-2 |
|||
SELECT * FROM t1; |
|||
f1 |
|||
1 |
|||
# Case 2: Server is killed after the transaction gets prepared |
|||
# but before it is written into binlog. As there is not GTID assigned, |
|||
# the transaction must be rolled back during recovery. |
|||
connect con, localhost, root; |
|||
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL reached WAIT_FOR continue"; |
|||
INSERT INTO t1 VALUES (2); |
|||
connection default; |
|||
SET DEBUG_SYNC = "now WAIT_FOR reached"; |
|||
# Kill the server |
|||
Performing --wsrep-recover ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
WSREP_LAST_SEEN_GTID() |
|||
100-10-2 |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
@@GLOBAL.gtid_binlog_pos |
|||
100-10-2 |
|||
Expect 1 |
|||
SELECT * FROM t1; |
|||
f1 |
|||
1 |
|||
disconnect con; |
|||
# Case 3: Server is killed after the transaction gets written into binlog |
|||
# but before it is committed in storage engine. In this case the |
|||
# transaction must be committed during recovery as it had a valid |
|||
# GTID assigned. |
|||
connect con, localhost, root; |
|||
SET DEBUG_SYNC = "commit_before_get_LOCK_commit_ordered SIGNAL reached WAIT_FOR continue"; |
|||
INSERT INTO t1 VALUES (3); |
|||
connection default; |
|||
SET DEBUG_SYNC = "now WAIT_FOR reached"; |
|||
# Kill the server |
|||
Performing --wsrep-recover ... |
|||
Using --wsrep-start-position when starting mysqld ... |
|||
Expect 100-10-3 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
WSREP_LAST_SEEN_GTID() |
|||
100-10-3 |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
@@GLOBAL.gtid_binlog_pos |
|||
100-10-3 |
|||
Expect 1 3 |
|||
SELECT * FROM t1; |
|||
f1 |
|||
1 |
|||
3 |
|||
disconnect con; |
|||
DROP TABLE t1; |
@ -0,0 +1,10 @@ |
|||
!include ../my.cnf |
|||
|
|||
[mysqld.1] |
|||
wsrep-on=ON |
|||
wsrep-provider=@ENV.WSREP_PROVIDER |
|||
wsrep-cluster-address=gcomm:// |
|||
binlog-format=ROW |
|||
wsrep-gtid-domain-id=100 |
|||
server-id=10 |
|||
innodb-autoinc-lock-mode=2 |
@ -0,0 +1,28 @@ |
|||
# Test wsrep GTID recovery with binlog off. The test restarts the server |
|||
# and verifies that the GTID returned by SELECT WSREP_LAST_SEEN_GTID() |
|||
# gets initialized properly during server restart. |
|||
# |
|||
--source include/have_wsrep.inc |
|||
--source include/have_wsrep_provider.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
|||
|
|||
--echo # Case 1: Server goes through graceful shutdown and is restarted |
|||
--connection default |
|||
INSERT INTO t1 VALUES (1); |
|||
|
|||
--echo Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
|
|||
--source include/shutdown_mysqld.inc |
|||
--let $galera_wsrep_recover_server_id = 1 |
|||
--source suite/galera/include/galera_wsrep_recover.inc |
|||
--source suite/galera/include/start_mysqld.inc |
|||
|
|||
--echo Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
SELECT * FROM t1; |
|||
|
|||
DROP TABLE t1; |
@ -0,0 +1,14 @@ |
|||
!include ../my.cnf |
|||
|
|||
[mysqld.1] |
|||
wsrep-on=ON |
|||
wsrep-provider=@ENV.WSREP_PROVIDER |
|||
wsrep-cluster-address=gcomm:// |
|||
binlog-format=ROW |
|||
log-bin |
|||
log-slave-updates |
|||
gtid-domain-id=10 |
|||
gtid-strict-mode=ON |
|||
wsrep-gtid-mode=ON |
|||
wsrep-gtid-domain-id=100 |
|||
server-id=10 |
@ -0,0 +1,73 @@ |
|||
# Test wsrep recovery with gtid_mode=ON. The test crashes the server |
|||
# in different commit stages and verifies that the GTID returned by |
|||
# SELECT WSREP_LAST_SEEN_GTID() and @@GLOBAL.gtid_binlog_pos get |
|||
# initialized properly during server restart. |
|||
# |
|||
--source include/have_wsrep.inc |
|||
--source include/have_wsrep_provider.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_log_bin.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; |
|||
|
|||
--echo # Case 1: Server goes through graceful shutdown and is restarted |
|||
--connection default |
|||
INSERT INTO t1 VALUES (1); |
|||
--source include/shutdown_mysqld.inc |
|||
--let $galera_wsrep_recover_server_id = 1 |
|||
--source suite/galera/include/galera_wsrep_recover.inc |
|||
--source suite/galera/include/start_mysqld.inc |
|||
|
|||
--echo Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
SELECT * FROM t1; |
|||
|
|||
--echo # Case 2: Server is killed after the transaction gets prepared |
|||
--echo # but before it is written into binlog. As there is not GTID assigned, |
|||
--echo # the transaction must be rolled back during recovery. |
|||
--connect con, localhost, root |
|||
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL reached WAIT_FOR continue"; |
|||
--send INSERT INTO t1 VALUES (2) |
|||
|
|||
--connection default |
|||
SET DEBUG_SYNC = "now WAIT_FOR reached"; |
|||
--source include/kill_mysqld.inc |
|||
--let $galera_wsrep_recover_server_id = 1 |
|||
--source suite/galera/include/galera_wsrep_recover.inc |
|||
--source suite/galera/include/start_mysqld.inc |
|||
--source include/wait_wsrep_ready.inc |
|||
|
|||
--echo Expect 100-10-2 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
--echo Expect 1 |
|||
SELECT * FROM t1; |
|||
--disconnect con |
|||
|
|||
--echo # Case 3: Server is killed after the transaction gets written into binlog |
|||
--echo # but before it is committed in storage engine. In this case the |
|||
--echo # transaction must be committed during recovery as it had a valid |
|||
--echo # GTID assigned. |
|||
|
|||
--connect con, localhost, root |
|||
SET DEBUG_SYNC = "commit_before_get_LOCK_commit_ordered SIGNAL reached WAIT_FOR continue"; |
|||
--send INSERT INTO t1 VALUES (3) |
|||
|
|||
--connection default |
|||
SET DEBUG_SYNC = "now WAIT_FOR reached"; |
|||
--source include/kill_mysqld.inc |
|||
--let $galera_wsrep_recover_server_id = 1 |
|||
--source suite/galera/include/galera_wsrep_recover.inc |
|||
--source suite/galera/include/start_mysqld.inc |
|||
--source include/wait_wsrep_ready.inc |
|||
--echo Expect 100-10-3 |
|||
SELECT WSREP_LAST_SEEN_GTID(); |
|||
SELECT @@GLOBAL.gtid_binlog_pos; |
|||
--echo Expect 1 3 |
|||
SELECT * FROM t1; |
|||
|
|||
--disconnect con |
|||
|
|||
DROP TABLE t1; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue