diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:24:36 +0000 |
commit | 06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/galera_sr/r | |
parent | Initial commit. (diff) | |
download | mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/galera_sr/r')
98 files changed, 5126 insertions, 0 deletions
diff --git a/mysql-test/suite/galera_sr/r/GCF-1008.result b/mysql-test/suite/galera_sr/r/GCF-1008.result new file mode 100644 index 00000000..f55f6f33 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-1008.result @@ -0,0 +1,70 @@ +connection node_2; +connection node_1; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) ENGINE=InnoDB; +connection node_2; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'x'); +connection node_2a; +SET GLOBAL wsrep_provider_options = 'dbug=d,before_local_commit_monitor_enter'; +connection node_2; +COMMIT; +connection node_2b; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +connection node_1; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 1; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 +1 +REPLACE INTO t1 VALUES (1,'y'); +connection node_2b; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +connection node_2a; +SET GLOBAL wsrep_provider_options = 'signal=before_local_commit_monitor_enter'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 +1 +DROP TABLE t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) ENGINE=InnoDB; +connection node_2; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'x'); +connection node_2a; +SET GLOBAL wsrep_provider_options = 'dbug=d,before_certify_apply_monitor_enter'; +connection node_2; +COMMIT; +connection node_2b; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +connection node_1; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 1; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 +1 +REPLACE INTO t1 VALUES (1,'y'); +connection node_2b; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +connection node_2a; +SET GLOBAL wsrep_provider_options = 'signal=before_certify_apply_monitor_enter'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-1018.result b/mysql-test/suite/galera_sr/r/GCF-1018.result new file mode 100644 index 00000000..12a4d3c7 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-1018.result @@ -0,0 +1,25 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +INSERT INTO t1 (f2) VALUES ('a'); +INSERT INTO t1 (f2) VALUES ('b'); +INSERT INTO t1 (f2) VALUES ('c'); +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_certify_apply_monitor_enter'; +connection node_2; +SET SESSION wsrep_retry_autocommit = 0; +SET SESSION wsrep_trx_fragment_size = 64; +DELETE FROM t1 ORDER BY f1 DESC LIMIT 2;; +connection node_2a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +connection node_1; +INSERT INTO t1 (f2) VALUES ('d'),('e'); +connection node_2a; +SET GLOBAL wsrep_provider_options = 'signal=after_certify_apply_monitor_enter'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-1018B.result b/mysql-test/suite/galera_sr/r/GCF-1018B.result new file mode 100644 index 00000000..4752c072 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-1018B.result @@ -0,0 +1,12 @@ +connection node_2; +connection node_1; +connection node_1; +SET SESSION wsrep_sync_wait = 0; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 64; +SET SESSION innodb_lock_wait_timeout = 1000; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 64; +SET SESSION innodb_lock_wait_timeout = 1000; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-1051.result b/mysql-test/suite/galera_sr/r/GCF-1051.result new file mode 100644 index 00000000..82fa389b --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-1051.result @@ -0,0 +1,46 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size=1; +connection node_1; +START TRANSACTION; +SAVEPOINT A; +INSERT INTO t1 VALUES (1); +ROLLBACK TO SAVEPOINT A; +COMMIT; +connection node_1; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=OFF; +SAVEPOINT A; +INSERT INTO t1 VALUES (2); +ROLLBACK TO SAVEPOINT A; +COMMIT; +connection node_1; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-1060.result b/mysql-test/suite/galera_sr/r/GCF-1060.result new file mode 100644 index 00000000..58af97d0 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-1060.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +Running a concurrent test with the following queries: +TRUNCATE TABLE t1 +INSERT INTO t1 VALUE (1,'x'),(2,'x'),(3,'x') +INSERT INTO t1 VALUE (4, 'z'); +connection node_1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 1;;; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 1;;; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_trx_fragment_size = 1;;; +include/diff_servers.inc [servers=1 2] +DROP TABLE t1; +Concurrent test end diff --git a/mysql-test/suite/galera_sr/r/GCF-561.result b/mysql-test/suite/galera_sr/r/GCF-561.result new file mode 100644 index 00000000..ec5ec786 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-561.result @@ -0,0 +1,52 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) AS EXPECT_5 FROM mysql.wsrep_streaming_log; +EXPECT_5 +5 +ALTER TABLE t1 DROP COLUMN f2; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_1; +INSERT INTO t1 VALUES (6, 6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +INSERT INTO t1 VALUES (6, 6); +ERROR 21S01: Column count doesn't match value count at row 1 +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +COMMIT; +connection node_2; +set global wsrep_sync_wait=15; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT COUNT(*) AS EXPECT_5 FROM t1; +EXPECT_5 +5 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-571.result b/mysql-test/suite/galera_sr/r/GCF-571.result new file mode 100644 index 00000000..fd20afd7 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-571.result @@ -0,0 +1,67 @@ +connection node_2; +connection node_1; +SET AUTOCOMMIT=OFF; +CREATE TABLE t1 (f1 VARCHAR(10)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES ('%abcdef%'); +INSERT INTO t1 VALUES ('%abcdef%'); +INSERT INTO t1 VALUES ('%abcdef%'); +INSERT INTO t1 VALUES ('%abcdef%'); +SAVEPOINT A; +INSERT INTO t1 VALUES ('xyzxyz'); +INSERT INTO t1 VALUES ('xyzxyz'); +INSERT INTO t1 VALUES ('xyzxyz'); +INSERT INTO t1 VALUES ('xyzxyz'); +INSERT INTO t1 VALUES ('xyzxyz'); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%'; +COUNT(*) = 1 +1 +connection node_1; +ROLLBACK TO SAVEPOINT A; +connection node_1a; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%ROLLBACK TO `A`%'; +COUNT(*) = 1 +0 +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%abcdef%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%xyz%'; +COUNT(*) > 0 +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%SAVEPOINT `A`%'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM mysql.wsrep_streaming_log WHERE frag LIKE '%ROLLBACK TO `A`%'; +COUNT(*) = 1 +0 +connection node_1; +ROLLBACK; +connection node_1a; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-572.result b/mysql-test/suite/galera_sr/r/GCF-572.result new file mode 100644 index 00000000..41ae2378 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-572.result @@ -0,0 +1,59 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY); +INSERT INTO t2 VALUES (1),(2),(3); +ALTER TABLE t2 DROP PRIMARY KEY; +INSERT INTO t2 VALUES (1); +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 SELECT * FROM t2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT * FROM t1; +f1 +connection node_2; +SELECT * FROM t1; +f1 +connection node_1; +DROP TABLE t1; +DROP TABLE t2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(10)) ENGINE=InnoDB; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'node1'); +connection node_1a; +INSERT INTO t1 VALUES (5, 'node2'); +connection node_1; +INSERT INTO t1 VALUES (5, 'node1'); +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +SELECT * FROM t1; +f1 f2 +1 node1 +5 node2 +SET SESSION wsrep_trx_fragment_size = 10000; +START TRANSACTION; +INSERT INTO t1 VALUE (10, 'node1'); +SELECT * FROM mysql.wsrep_streaming_log; +node_uuid trx_id seqno flags frag +connection node_1a; +INSERT INTO t1 VALUES(15, 'node2'); +connection node_1; +SELECT * FROM t1; +f1 f2 +1 node1 +5 node2 +10 node1 +INSERT INTO t1 VALUES(15, 'node1'); +ERROR 23000: Duplicate entry '15' for key 'PRIMARY' +COMMIT; +SELECT * FROM t1; +f1 f2 +1 node1 +5 node2 +10 node1 +15 node2 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-580.result b/mysql-test/suite/galera_sr/r/GCF-580.result new file mode 100644 index 00000000..3ee69c6c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-580.result @@ -0,0 +1,13 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +last_committed_matches_fragment_count +1 +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-585.result b/mysql-test/suite/galera_sr/r/GCF-585.result new file mode 100644 index 00000000..ab5fed59 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-585.result @@ -0,0 +1,28 @@ +connection node_2; +connection node_1; +create table t1 (f1 integer primary key) engine=innodb; +set autocommit=off; +set session wsrep_trx_fragment_size=1; +start transaction; +insert into t1 values (1); +insert into t1 values (2),(1); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +alter table t1 drop primary key; +drop table t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SET SESSION wsrep_trx_fragment_size=1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +update t1 set f1 = 100 where f1 = 10; +connection node_2; +INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); +SET SESSION wsrep_trx_fragment_size=1; +SET SESSION innodb_lock_wait_timeout=1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +delete from t1 where f1 > 10; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +delete from t1 where f1 > 10 and f1 < 100; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-597.result b/mysql-test/suite/galera_sr/r/GCF-597.result new file mode 100644 index 00000000..52b13ba3 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-597.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +SET wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connection node_1; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +connection node_2; +ROLLBACK; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; +disconnect node_1a; +disconnect node_2a; diff --git a/mysql-test/suite/galera_sr/r/GCF-620.result b/mysql-test/suite/galera_sr/r/GCF-620.result new file mode 100644 index 00000000..02cb163a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-620.result @@ -0,0 +1,18 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size = 200; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (1); +SAVEPOINT A; +INSERT INTO t1 VALUES (1); +ROLLBACK TO SAVEPOINT A; +COMMIT; +connection node_2; +SELECT COUNT(*) = 2 FROM t1; +COUNT(*) = 2 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-623.result b/mysql-test/suite/galera_sr/r/GCF-623.result new file mode 100644 index 00000000..f3500b7a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-623.result @@ -0,0 +1,29 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-627.result b/mysql-test/suite/galera_sr/r/GCF-627.result new file mode 100644 index 00000000..7cd2ab63 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-627.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER, f2 VARCHAR(10)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +connection node_2; +DROP TABLE t1; +connection node_1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +INSERT INTO t1 VALUES (2); +ERROR 42S02: Table 'test.t1' doesn't exist +connection node_1; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_2; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 diff --git a/mysql-test/suite/galera_sr/r/GCF-845.result b/mysql-test/suite/galera_sr/r/GCF-845.result new file mode 100644 index 00000000..df842049 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-845.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +CREATE TABLE IF NOT EXISTS t1 (f1 INTEGER) ENGINE = InnoDB; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET SESSION AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (161); +COMMIT; +DELETE FROM t1 WHERE f1 > 13; +disconnect node_1a; +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; +include/assert_grep.inc [No BF-BF log line found] diff --git a/mysql-test/suite/galera_sr/r/GCF-851.result b/mysql-test/suite/galera_sr/r/GCF-851.result new file mode 100644 index 00000000..52aa4c78 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-851.result @@ -0,0 +1,30 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION WSREP_TRX_FRAGMENT_SIZE=1; +SET SESSION AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (10); +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_1; +START TRANSACTION; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SELECT COUNT(*) > 0 FROM t1; +COUNT(*) > 0 +1 +connection node_1; +SELECT COUNT(*) > 0 FROM t1; +COUNT(*) > 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-867.result b/mysql-test/suite/galera_sr/r/GCF-867.result new file mode 100644 index 00000000..9521a86d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-867.result @@ -0,0 +1,4 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-889.result b/mysql-test/suite/galera_sr/r/GCF-889.result new file mode 100644 index 00000000..617377de --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-889.result @@ -0,0 +1,25 @@ +connection node_2; +connection node_1; +connection node_2; +SET GLOBAL wsrep_ignore_apply_errors = 2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_on = OFF; +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_on = ON; +SET SESSION wsrep_trx_fragment_size = 1; +DELETE FROM t1 WHERE f1 = 1; +SET SESSION wsrep_trx_fragment_size = 0; +INSERT INTO t1 VALUES (1); +SELECT COUNT(*) = 1; +COUNT(*) = 1 +1 +connection node_2; +SELECT COUNT(*) = 1; +COUNT(*) = 1 +1 +CALL mtr.add_suppression("Could not execute Delete_rows event on table"); +CALL mtr.add_suppression("Can't find record in 't1'"); +SET GLOBAL wsrep_ignore_apply_errors = 7; +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/GCF-900.result b/mysql-test/suite/galera_sr/r/GCF-900.result new file mode 100644 index 00000000..caa2d2c4 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/GCF-900.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT) ENGINE=InnoDB; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 128; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 0); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (2, 0); +connection node_2; +ALTER TABLE t1 DROP COLUMN f2; +connection node_1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1a; +INSERT INTO t1 VALUES (3, 0); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-18585.result b/mysql-test/suite/galera_sr/r/MDEV-18585.result new file mode 100644 index 00000000..44c36375 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-18585.result @@ -0,0 +1,36 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY); +SET SESSION wsrep_trx_fragment_unit='ROWS'; +SET SESSION wsrep_trx_fragment_size=1; +INSERT INTO t1 VALUES (1), (2); +SET SESSION wsrep_trx_fragment_unit='BYTES'; +SET SESSION wsrep_trx_fragment_size=1; +INSERT INTO t1 VALUES (3), (4); +SET SESSION wsrep_trx_fragment_unit='STATEMENTS'; +SET SESSION wsrep_trx_fragment_size=1; +INSERT INTO t1 VALUES (5), (6); +SET SESSION wsrep_trx_fragment_unit=default; +SET SESSION wsrep_trx_fragment_size=default; +SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 527; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-2 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (1), (2) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-3 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (3), (4) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ +mysqld-bin.000002 # Gtid 1 # BEGIN GTID 0-1-4 +mysqld-bin.000002 # Annotate_rows 1 # INSERT INTO t1 VALUES (5), (6) +mysqld-bin.000002 # Table_map 1 # table_id: # (test.t1) +mysqld-bin.000002 # Write_rows_v1 1 # table_id: # flags: STMT_END_F +mysqld-bin.000002 # Xid 1 # COMMIT /* xid=# */ +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-21613.result b/mysql-test/suite/galera_sr/r/MDEV-21613.result new file mode 100644 index 00000000..67af2d49 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-21613.result @@ -0,0 +1,20 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET DEBUG_SYNC = "wsrep_before_fragment_removal SIGNAL fragment_removal_reached WAIT_FOR fragment_removal_continue"; +START TRANSACTION; +INSERT INTO t1 VALUES(1), (2); +COMMIT; +connect node_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_ctrl; +SET DEBUG_SYNC = "now WAIT_FOR fragment_removal_reached"; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +TRUNCATE TABLE t1; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_ctrl; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-22616.result b/mysql-test/suite/galera_sr/r/MDEV-22616.result new file mode 100644 index 00000000..0c3847bd --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-22616.result @@ -0,0 +1,13 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +START TRANSACTION; +INSERT INTO t1 VALUES (1); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-23623.result b/mysql-test/suite/galera_sr/r/MDEV-23623.result new file mode 100644 index 00000000..edba2a16 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-23623.result @@ -0,0 +1,26 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +INSERT INTO t1 (f2) VALUES ('a'); +INSERT INTO t1 (f2) VALUES ('b'); +INSERT INTO t1 (f2) VALUES ('c'); +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_certify_apply_monitor_enter'; +connection node_2; +SET SESSION wsrep_retry_autocommit = 0; +SET SESSION wsrep_trx_fragment_size = 64; +DELETE FROM t1 ORDER BY f1 DESC LIMIT 2;; +connection node_2a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +connection node_1; +INSERT INTO t1 (f2) VALUES ('d'),('e'); +connection node_2a; +SET GLOBAL wsrep_provider_options = 'signal=after_certify_apply_monitor_enter'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-25226.result b/mysql-test/suite/galera_sr/r/MDEV-25226.result new file mode 100644 index 00000000..46990235 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-25226.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +SET SESSION wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +SET GLOBAL wsrep_on=OFF; +ERROR 25000: You are not allowed to execute this command in a transaction +INSERT INTO t1 VALUES(2); +COMMIT; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-25717.result b/mysql-test/suite/galera_sr/r/MDEV-25717.result new file mode 100644 index 00000000..22f8d5eb --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-25717.result @@ -0,0 +1,47 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; +INSERT INTO t1 VALUES (1), (2), (3); +connection node_2; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (4); +connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +3 +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_toi"; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_bf_abort"; +connection node_1; +TRUNCATE TABLE t1; +connection node_1a; +SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_bf_abort_reached"; +connection node_2a; +SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached"; +connection node_2; +INSERT INTO t1 VALUES (5); +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = DEFAULT; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi"; +connection node_2; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1a; +SET SESSION wsrep_sync_wait=0; +SET GLOBAL DEBUG_DBUG = "+d,sync.wsrep_log_dummy_write_set"; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_bf_abort"; +SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_log_dummy_write_set_reached"; +connection node_1; +connection node_2; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "RESET"; +connection node_1; +SET GLOBAL DEBUG_DBUG = ""; +SET DEBUG_SYNC = "RESET"; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-25718.result b/mysql-test/suite/galera_sr/r/MDEV-25718.result new file mode 100644 index 00000000..fa3f67fb --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-25718.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +SET debug_sync = "ha_write_row_end SIGNAL write_row_end WAIT_FOR write_row_continue"; +INSERT INTO t1 VALUES (1);; +connect node_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_ctrl; +SET debug_sync = "now WAIT_FOR write_row_end"; +SET GLOBAL debug_dbug = '+d,wsrep_streaming_rollback'; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +TRUNCATE TABLE t1;; +connection node_ctrl; +SET SESSION debug_sync = "now WAIT_FOR wsrep_streaming_rollback_reached"; +SET SESSION wsrep_sync_wait = 0; +SET debug_sync = "now SIGNAL write_row_continue"; +SET SESSION debug_sync = "now SIGNAL wsrep_streaming_rollback_continue"; +connection node_1a; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_ctrl; +SET GLOBAL debug_dbug = ""; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-27553.result b/mysql-test/suite/galera_sr/r/MDEV-27553.result new file mode 100644 index 00000000..5a6a5bd4 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-27553.result @@ -0,0 +1,36 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +connection node_2; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log; +Expect 1 +1 +SET @@global.debug_dbug="+d,ha_index_init_fail"; +ROLLBACK; +connection node_1; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log; +Expect 0 +0 +connection node_2; +SET @@global.debug_dbug=""; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) `Expect 1` FROM mysql.wsrep_streaming_log; +Expect 1 +1 +connection node_2; +SET GLOBAL wsrep_on=OFF; +# restart +SELECT COUNT(*) `Expect 0` FROM mysql.wsrep_streaming_log; +Expect 0 +0 +DROP TABLE t1; +CALL mtr.add_suppression("WSREP: Failed to init table for index scan"); +CALL mtr.add_suppression("WSREP: Failed to apply write set"); +CALL mtr.add_suppression("Failed to report last committed"); diff --git a/mysql-test/suite/galera_sr/r/MDEV-27615.result b/mysql-test/suite/galera_sr/r/MDEV-27615.result new file mode 100644 index 00000000..e3bfd0ed --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-27615.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; +SET DEBUG_SYNC='wsrep_before_fragment_certification SIGNAL before_fragment WAIT_FOR continue'; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1);; +connection node_2a; +SET SESSION wsrep_sync_wait = 0; +SET DEBUG_SYNC='now WAIT_FOR before_fragment'; +SET GLOBAL wsrep_cluster_address = ''; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_2; +ERROR HY000: Lost connection to server during query +connection node_2a; +SELECT * FROM mysql.wsrep_streaming_log; +node_uuid trx_id seqno flags frag +SELECT * FROM t1; +f1 +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; diff --git a/mysql-test/suite/galera_sr/r/MDEV-30838.result b/mysql-test/suite/galera_sr/r/MDEV-30838.result new file mode 100644 index 00000000..6997b9c4 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-30838.result @@ -0,0 +1,15 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES(1); +SET debug_dbug='+d,ib_create_table_fail_too_many_trx'; +INSERT INTO t1 VALUES(2); +ERROR HY000: Error while appending streaming replication fragment +COMMIT; +SELECT * FROM t1; +f1 +SET debug_dbug='-d,ib_create_table_fail_too_many_trx'; +DROP TABLE t1; +CALL mtr.add_suppression("Error writing into mysql.wsrep_streaming_log: 177"); diff --git a/mysql-test/suite/galera_sr/r/MDEV-30862.result b/mysql-test/suite/galera_sr/r/MDEV-30862.result new file mode 100644 index 00000000..43da77f2 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-30862.result @@ -0,0 +1,11 @@ +connection node_2; +connection node_1; +SET autocommit=0; +SET SESSION wsrep_trx_fragment_size=1; +CREATE TABLE t2 SELECT seq FROM seq_1_to_50; +ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication +CREATE TABLE t1 (f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES(DEFAULT); +CREATE TABLE t2 SELECT * FROM t1; +ERROR 42000: CREATE TABLE AS SELECT is not supported with streaming replication +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/MDEV-32051.result b/mysql-test/suite/galera_sr/r/MDEV-32051.result new file mode 100644 index 00000000..2328bdb5 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/MDEV-32051.result @@ -0,0 +1,38 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1); +connection node_1; +SET SESSION wsrep_trx_fragment_size=1; +SET DEBUG_SYNC='wsrep_before_certification SIGNAL before_fragment WAIT_FOR continue'; +INSERT INTO t1 VALUES (2); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET SESSION wsrep_sync_wait=0; +SET DEBUG_SYNC='now WAIT_FOR before_fragment'; +SET GLOBAL wsrep_provider_options = 'dbug=d,before_replicate_sync'; +SET DEBUG_SYNC='now SIGNAL continue'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET DEBUG_SYNC='RESET'; +connection node_2; +TRUNCATE TABLE t1; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'signal=before_replicate_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_1; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_2; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera-features#56.result b/mysql-test/suite/galera_sr/r/galera-features#56.result new file mode 100644 index 00000000..15fcb475 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera-features#56.result @@ -0,0 +1,38 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +connection node_1; +CREATE TABLE ten (f1 INTEGER NOT NULL PRIMARY KEY) Engine=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +connection node_2; +set session wsrep_sync_wait=15; +SELECT COUNT(*) from ten; +COUNT(*) +10 +SELECT COUNT(*) from t1; +COUNT(*) +0 +set session wsrep_sync_wait=0; +SET GLOBAL wsrep_slave_threads = 4; +SET SESSION wsrep_trx_fragment_size = 1; +connection node_1; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; +connection node_1a; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; +connection node_2; +INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2;; +connection node_1; +connection node_1a; +connection node_2; +set session wsrep_sync_wait=15; +SELECT COUNT(*) FROM t1; +COUNT(*) +300 +SELECT COUNT(DISTINCT f1) FROM t1; +COUNT(DISTINCT f1) +300 +connection default; +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_bf_abort.result b/mysql-test/suite/galera_sr/r/galera_sr_bf_abort.result new file mode 100644 index 00000000..bf92a48b --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_bf_abort.result @@ -0,0 +1,555 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait = 0; +galera_sr_bf_abort_at_commit = 0 +after_replicate_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync'; +connection node_1; +INSERT INTO t1 VALUES (3); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +local_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; +connection node_1; +INSERT INTO t1 VALUES (3); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +apply_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_master_enter_sync'; +connection node_1; +INSERT INTO t1 VALUES (3); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_master_enter_sync'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +commit_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; +connection node_1; +INSERT INTO t1 VALUES (3); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +galera_sr_bf_abort_at_commit = 1 +after_replicate_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_replicate_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=after_replicate_sync'; +connection node_1; +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +local_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; +connection node_1; +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +apply_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_master_enter_sync'; +connection node_1; +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +commit_monitor_master_enter_sync +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 FOR UPDATE; +f1 +1 +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (2); +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +connection node_1; +ROLLBACK; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +2 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 0; +DELETE FROM t1; +DROP TABLE t1; +CALL mtr.add_suppression("WSREP: fragment replication failed: 1"); diff --git a/mysql-test/suite/galera_sr/r/galera_sr_blob.result b/mysql-test/suite/galera_sr/r/galera_sr_blob.result new file mode 100644 index 00000000..db25f54a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_blob.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 TEXT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_2; +connection node_1; +INSERT INTO t1 VALUES (REPEAT('x', 65535)); +connection node_2; +wsrep_last_committed_delta +1 +connection node_1; +COMMIT; +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT LENGTH(f1) = 65535 FROM t1; +LENGTH(f1) = 65535 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result new file mode 100644 index 00000000..1f874aca --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_master.result @@ -0,0 +1,66 @@ +connection node_2; +connection node_1; +CALL mtr.add_suppression("WSREP: discarding established.*"); +connection node_1; +connection node_2; +connection node_2; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +5 +connection node_1; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +5 +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET SESSION wsrep_sync_wait=0; +SET GLOBAL wsrep_cluster_address = ''; +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_2; +INSERT INTO t1 VALUES (6); +ERROR HY000: Lost connection to server during query +connection node_1; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_2a; +connection node_1; +connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2b; +SELECT * FROM mysql.wsrep_streaming_log; +node_uuid trx_id seqno flags frag +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +COMMIT; +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +DROP TABLE t1; +connection node_2b; +CALL mtr.add_suppression("WSREP: Failed to replicate rollback fragment for"); +disconnect node_2; +connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result new file mode 100644 index 00000000..982d8b3a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_no_primary.result @@ -0,0 +1,70 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_1; +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +BEGIN; +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (11); +INSERT INTO t1 VALUES (12); +connection node_2; +SET SESSION wsrep_trx_fragment_size=1; +BEGIN; +INSERT INTO t1 VALUES (20); +INSERT INTO t1 VALUES (21); +INSERT INTO t1 VALUES (22); +SELECT COUNT(*) `expect 6` FROM mysql.wsrep_streaming_log; +expect 6 +6 +connection node_2a; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +SET SESSION wsrep_sync_wait = 0; +SHOW STATUS LIKE 'wsrep_cluster_size'; +Variable_name Value +wsrep_cluster_size 1 +SHOW STATUS LIKE 'wsrep_cluster_status'; +Variable_name Value +wsrep_cluster_status non-Primary +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SHOW STATUS LIKE 'wsrep_cluster_size'; +Variable_name Value +wsrep_cluster_size 1 +SHOW STATUS LIKE 'wsrep_cluster_status'; +Variable_name Value +wsrep_cluster_status non-Primary +SET SESSION wsrep_sync_wait = DEFAULT; +connection node_2a; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +SHOW STATUS LIKE 'wsrep_cluster_size'; +Variable_name Value +wsrep_cluster_size 2 +connection node_1a; +SHOW STATUS LIKE 'wsrep_cluster_size'; +Variable_name Value +wsrep_cluster_size 2 +SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log; +expect 0 +0 +connection node_2a; +SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log; +expect 0 +0 +INSERT INTO t1 VALUES(10); +INSERT INTO t1 VALUES(20); +SELECT * FROM t1; +f1 +10 +20 +connection node_1; +INSERT INTO t1 VALUES(13); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_2; +INSERT INTO t1 VALUES(23); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_cc_slave.result b/mysql-test/suite/galera_sr/r/galera_sr_cc_slave.result new file mode 100644 index 00000000..d439380e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_cc_slave.result @@ -0,0 +1,61 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_2; +SET GLOBAL wsrep_cluster_address = ''; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_sync_wait = default; +connection node_1; +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (7); +INSERT INTO t1 VALUES (8); +INSERT INTO t1 VALUES (9); +INSERT INTO t1 VALUES (10); +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_1; +INSERT INTO t1 VALUES (11); +INSERT INTO t1 VALUES (12); +INSERT INTO t1 VALUES (13); +INSERT INTO t1 VALUES (14); +INSERT INTO t1 VALUES (16); +COMMIT; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; +CALL mtr.add_suppression("points to own listening address, blacklisting"); diff --git a/mysql-test/suite/galera_sr/r/galera_sr_concurrent.result b/mysql-test/suite/galera_sr/r/galera_sr_concurrent.result new file mode 100644 index 00000000..75acba36 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_concurrent.result @@ -0,0 +1,36 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t2 VALUES (1); +INSERT INTO t2 VALUES (2); +INSERT INTO t2 VALUES (3); +INSERT INTO t2 VALUES (4); +INSERT INTO t2 VALUES (5); +connection node_1; +COMMIT; +connection node_1a; +COMMIT; +connection node_2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +SELECT COUNT(*) = 5 FROM t2; +COUNT(*) = 5 +1 +connection node_1; +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_conflict.result b/mysql-test/suite/galera_sr/r/galera_sr_conflict.result new file mode 100644 index 00000000..a45bffea --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_conflict.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +INSERT INTO t1 VALUES(1);; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_1; +COMMIT; +connection node_2; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit.result b/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit.result new file mode 100644 index 00000000..5de1ac24 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit.result @@ -0,0 +1,31 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connection node_1; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +COMMIT; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit2.result b/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit2.result new file mode 100644 index 00000000..2ee3d4c7 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_conflict_on_commit2.result @@ -0,0 +1,28 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_1; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +INSERT INTO t1 VALUES (5);; +connection node_1; +COMMIT; +connection node_2; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_conflict_with_rollback_master.result b/mysql-test/suite/galera_sr/r/galera_sr_conflict_with_rollback_master.result new file mode 100644 index 00000000..92bf007e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_conflict_with_rollback_master.result @@ -0,0 +1,29 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connection node_1; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +ROLLBACK; +connection node_2; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_create_drop.result b/mysql-test/suite/galera_sr/r/galera_sr_create_drop.result new file mode 100644 index 00000000..5fa48e26 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_create_drop.result @@ -0,0 +1,28 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size=1; +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +connection node_2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(11) NOT NULL, + PRIMARY KEY (`f1`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection node_1; +DROP TABLE t1; +connection node_2; +SHOW CREATE TABLE t1; +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE DATABASE mdev_18587; +connection node_2; +SHOW DATABASES LIKE 'mdev_18587'; +Database (mdev_18587) +mdev_18587 +connection node_1; +DROP DATABASE mdev_18587; +connection node_2; +SHOW DATABASES LIKE 'mdev_18587'; +Database (mdev_18587) +connection node_1; +SET SESSION wsrep_trx_fragment_size=DEFAULT; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ddl_master.result b/mysql-test/suite/galera_sr/r/galera_sr_ddl_master.result new file mode 100644 index 00000000..5858a9c6 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ddl_master.result @@ -0,0 +1,65 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT COUNT(*) as expect_5 FROM mysql.wsrep_streaming_log; +expect_5 +5 +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_1; +INSERT INTO t1 VALUES (6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log; +expect_0 +0 +ROLLBACK; +START TRANSACTION; +INSERT INTO t1 (f1) VALUES (1); +INSERT INTO t1 (f1) VALUES (2); +INSERT INTO t1 (f1) VALUES (3); +INSERT INTO t1 (f1) VALUES (4); +INSERT INTO t1 (f1) VALUES (5); +INSERT INTO t1 (f1) VALUES (6); +COMMIT; +SELECT COUNT(*) as expect_6 FROM t1; +expect_6 +6 +SELECT * FROM t1; +f1 f2 +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL +6 NULL +SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log; +expect_0 +0 +connection node_2; +SELECT COUNT(*) as expect_6 FROM t1; +expect_6 +6 +SELECT * FROM t1; +f1 f2 +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL +6 NULL +SELECT COUNT(*) as expect_0 FROM mysql.wsrep_streaming_log; +expect_0 +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ddl_schema.result b/mysql-test/suite/galera_sr/r/galera_sr_ddl_schema.result new file mode 100644 index 00000000..fcd6cfa4 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ddl_schema.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +DROP SCHEMA test; +SELECT COUNT(*) = 0 FROM test.t1; +ERROR 42S02: Table 'test.t1' doesn't exist +connection node_1; +INSERT INTO test.t1 VALUES (6, 6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +INSERT INTO test.t1 VALUES (6, 6); +ERROR 42S02: Table 'test.t1' doesn't exist +CREATE SCHEMA test; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ddl_slave.result b/mysql-test/suite/galera_sr/r/galera_sr_ddl_slave.result new file mode 100644 index 00000000..58663caf --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ddl_slave.result @@ -0,0 +1,50 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +ALTER TABLE t1 DROP COLUMN f2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +INSERT INTO t1 VALUES (6, 6); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +INSERT INTO t1 VALUES (6, 6); +ERROR 21S01: Column count doesn't match value count at row 1 +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +COMMIT; +connection node_2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ddl_unrelated.result b/mysql-test/suite/galera_sr/r/galera_sr_ddl_unrelated.result new file mode 100644 index 00000000..0f23ade5 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ddl_unrelated.result @@ -0,0 +1,42 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT INTO t1 VALUES (5, 5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +ALTER TABLE t2 DROP COLUMN f2; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +connection node_1; +INSERT INTO t1 VALUES (6, 6); +connection node_2; +connection node_1; +COMMIT; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 6 FROM t1; +COUNT(*) = 6 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_dupkey_error.result b/mysql-test/suite/galera_sr/r/galera_sr_dupkey_error.result new file mode 100644 index 00000000..ad843c7c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_dupkey_error.result @@ -0,0 +1,46 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB; +CREATE UNIQUE INDEX i1 ON t1 (f1(512)); +SET AUTOCOMMIT=OFF; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1024; +INSERT INTO t1 VALUES (REPEAT('a', 512)); +INSERT INTO t1 VALUES (REPEAT('b', 512)); +INSERT INTO t1 VALUES (REPEAT('c', 512)); +INSERT INTO t1 VALUES (REPEAT('d', 512)); +INSERT INTO t1 VALUES (REPEAT('e', 512)); +INSERT INTO t1 VALUES (REPEAT('f', 512)); +connection node_2; +connection node_1; +INSERT INTO t1 VALUES (REPEAT('g', 1024)),(REPEAT('c', 512)); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1; +INSERT INTO t1 VALUES (REPEAT('d', 512)); +INSERT INTO t1 VALUES (REPEAT('e', 512)); +INSERT INTO t1 VALUES (REPEAT('f', 512)); +COMMIT; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (REPEAT('a', 512)); +INSERT INTO t1 VALUES (REPEAT('b', 512)); +INSERT INTO t1 VALUES (REPEAT('c', 512)); +COMMIT; +connection node_1; +SELECT COUNT(*) = 6 FROM t1; +COUNT(*) = 6 +1 +connection node_2; +SELECT COUNT(*) = 6 FROM t1; +COUNT(*) = 6 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_fk_conflict.result b/mysql-test/suite/galera_sr/r/galera_sr_fk_conflict.result new file mode 100644 index 00000000..1d12533c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_fk_conflict.result @@ -0,0 +1,39 @@ +connection node_2; +connection node_1; +CREATE TABLE grandparent ( +id INT NOT NULL PRIMARY KEY +) ENGINE=InnoDB; +CREATE TABLE parent ( +id INT NOT NULL PRIMARY KEY, +grandparent_id INT, +FOREIGN KEY (grandparent_id) +REFERENCES grandparent(id) +ON UPDATE CASCADE +) ENGINE=InnoDB; +CREATE TABLE child ( +id INT NOT NULL PRIMARY KEY, +grandparent_id INT, +FOREIGN KEY (grandparent_id) +REFERENCES parent(grandparent_id) +ON UPDATE CASCADE +) ENGINE=InnoDB; +INSERT INTO grandparent VALUES (1),(2),(3),(4); +INSERT INTO parent VALUES (1,1), (2,2); +INSERT INTO child VALUES (1,1), (2,2); +connection node_1; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +UPDATE grandparent SET id = 5 WHERE id = 1; +connection node_2; +SET SESSION innodb_lock_wait_timeout = 1; +UPDATE grandparent SET id = 10 WHERE id = 5; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +DELETE FROM child; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +connection node_1; +COMMIT; +include/diff_servers.inc [servers=1 2] +DROP TABLE child; +DROP TABLE parent; +DROP TABLE grandparent; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_gtid.result b/mysql-test/suite/galera_sr/r/galera_sr_gtid.result new file mode 100644 index 00000000..be631d1d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_gtid.result @@ -0,0 +1,57 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +INSERT INTO t1 VALUES (1); +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SET SESSION wsrep_trx_fragment_size=1; +UPDATE t1 SET f1 = 2; +connection node_1; +SET SESSION wsrep_trx_fragment_size=0; +connection node_2; +SET SESSION wsrep_trx_fragment_size=0; +connection node_1; +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000002 <Pos> Gtid_list 1 <End_log_pos> [] +mysqld-bin.000002 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001 +mysqld-bin.000002 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000002 +mysqld-bin.000002 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1 +mysqld-bin.000002 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INT PRIMARY KEY) +mysqld-bin.000002 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000002 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1) +mysqld-bin.000002 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000002 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000002 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000002 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-3 +mysqld-bin.000002 <Pos> Annotate_rows 2 <End_log_pos> UPDATE t1 SET f1 = 2 +mysqld-bin.000002 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000002 <Pos> Update_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000002 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +connection node_2; +SELECT 1 FROM DUAL; +1 +1 +SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000003 <Pos> Gtid_list 2 <End_log_pos> [] +mysqld-bin.000003 <Pos> Binlog_checkpoint 2 <End_log_pos> mysqld-bin.000003 +mysqld-bin.000003 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1 +mysqld-bin.000003 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INT PRIMARY KEY) +mysqld-bin.000003 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000003 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1) +mysqld-bin.000003 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000003 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000003 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000003 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-3 +mysqld-bin.000003 <Pos> Annotate_rows 2 <End_log_pos> UPDATE t1 SET f1 = 2 +mysqld-bin.000003 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000003 <Pos> Update_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000003 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_insert_select.result b/mysql-test/suite/galera_sr/r/galera_sr_insert_select.result new file mode 100644 index 00000000..03022901 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_insert_select.result @@ -0,0 +1,18 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('a', 255) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +COMMIT; +connection node_2; +connection node_1; +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_all_nobootstrap.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_nobootstrap.result new file mode 100644 index 00000000..45ca6909 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_nobootstrap.result @@ -0,0 +1,31 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +Killing server ... +connection node_1; +Killing server ... +connection node_1; +# restart +connection node_2; +# restart +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_all_norecovery.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_norecovery.result new file mode 100644 index 00000000..7ef86c65 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_norecovery.result @@ -0,0 +1,35 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +connection node_2; +Killing server ... +connection node_1; +SET SESSION wsrep_sync_wait = 0; +Killing server ... +# restart +connection node_2; +# restart +connection node_1; +SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log; +expect 0 +0 +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) `expect 0` FROM t1; +expect 0 +0 +SELECT COUNT(*) `expect 0` FROM mysql.wsrep_streaming_log; +expect 0 +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_all_pcrecovery.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_pcrecovery.result new file mode 100644 index 00000000..7731c19e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_all_pcrecovery.result @@ -0,0 +1,32 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +Killing server ... +connection node_1; +Killing server ... +connection node_1; +# restart +connection node_2; +# restart +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_connection.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_connection.result new file mode 100644 index 00000000..96a85bc0 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_connection.result @@ -0,0 +1,32 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_2; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +COMMIT; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_1a; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_query.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_query.result new file mode 100644 index 00000000..c775cd85 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_query.result @@ -0,0 +1,41 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;; +connection node_2; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +Killing query ... +connection node_1; +ERROR 70100: Query execution was interrupted +connection node_2; +SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +INSERT INTO t1 SELECT 1 FROM ten AS t1, ten AS t2, ten AS t3; +SELECT COUNT(*) AS EXPECT_1000 FROM t1; +EXPECT_1000 +1000 +connection node_1; +SET GLOBAL wsrep_sync_wait=15; +SELECT COUNT(*) AS EXPECT_1000 FROM t1; +EXPECT_1000 +1000 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_2; +SELECT COUNT(*) AS EXPECT_1000 FROM t1; +EXPECT_1000 +1000 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_1; +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_kill_slave.result b/mysql-test/suite/galera_sr/r/galera_sr_kill_slave.result new file mode 100644 index 00000000..eab6110a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_kill_slave.result @@ -0,0 +1,54 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connection node_2; +SELECT COUNT(*) AS EXPECT_0 FROM t1; +EXPECT_0 +0 +connection node_1; +CREATE TABLE t2 (f1 INTEGER); +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +LOCK TABLE t2 WRITE; +connection node_1; +INSERT INTO t2 VALUES (1); +connection node_2; +SET SESSION wsrep_sync_wait = 0; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +Killing server ... +connection node_1; +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (7); +INSERT INTO t1 VALUES (8); +INSERT INTO t1 VALUES (9); +INSERT INTO t1 VALUES (10); +connection node_2; +# restart +connection node_1; +INSERT INTO t1 VALUES (11); +INSERT INTO t1 VALUES (12); +INSERT INTO t1 VALUES (13); +INSERT INTO t1 VALUES (14); +INSERT INTO t1 VALUES (15); +COMMIT; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_2; +SELECT COUNT(*) AS EXPECT_15 FROM t1; +EXPECT_15 +15 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +connection node_1; +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_large_fragment.result b/mysql-test/suite/galera_sr/r/galera_sr_large_fragment.result new file mode 100644 index 00000000..bf111f5c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_large_fragment.result @@ -0,0 +1,33 @@ +connection node_2; +connection node_1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(512)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1024 * 1024 * 10; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('x', 512) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) > 50000 FROM t1; +COUNT(*) > 50000 +1 +connection node_1; +ROLLBACK; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT10M'; +SET SESSION wsrep_sync_wait = 7; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +COUNT(*) = 0 +1 +COUNT(*) = 0 +1 diff --git a/mysql-test/suite/galera_sr/r/galera_sr_load_data.result b/mysql-test/suite/galera_sr/r/galera_sr_load_data.result new file mode 100644 index 00000000..99885b42 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_load_data.result @@ -0,0 +1,14 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 512; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connection node_2; +connection node_1; +connection node_2; +SELECT COUNT(*) = 20000 FROM t1; +COUNT(*) = 20000 +1 +wsrep_last_committed_diff +1 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_load_data_splitting.result b/mysql-test/suite/galera_sr/r/galera_sr_load_data_splitting.result new file mode 100644 index 00000000..61e4b56a --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_load_data_splitting.result @@ -0,0 +1,19 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 512; +SET GLOBAL wsrep_load_data_splitting = TRUE; +Warnings: +Warning 1287 '@@wsrep_load_data_splitting' is deprecated and will be removed in a future release +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connection node_2; +connection node_1; +connection node_2; +SELECT COUNT(*) = 95000 FROM t1; +COUNT(*) = 95000 +1 +wsrep_last_committed_diff +1 +connection node_1; +Warnings: +Warning 1287 '@@wsrep_load_data_splitting' is deprecated and will be removed in a future release +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_log_bin.result b/mysql-test/suite/galera_sr/r/galera_sr_log_bin.result new file mode 100644 index 00000000..cb8e8438 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_log_bin.result @@ -0,0 +1,124 @@ +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t3 (f1 INTEGER) ENGINE=InnoDB; +CREATE TABLE t4 (f1 INTEGER) ENGINE=InnoDB; +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; +SET GLOBAL wsrep_on=ON; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t2 VALUES (1); +connection node_2; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; +SET GLOBAL wsrep_on=ON; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t3 VALUES (1); +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t4 VALUES (1); +connection node_1; +INSERT INTO t1 VALUES (2); +COMMIT; +connection node_1a; +INSERT INTO t2 VALUES (2); +COMMIT; +connection node_2; +INSERT INTO t3 VALUES (2); +COMMIT; +connection node_2a; +INSERT INTO t4 VALUES (2); +COMMIT; +connection node_1; +SELECT COUNT(*) = 2 FROM t4; +COUNT(*) = 2 +1 +SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 <Pos> Gtid_list 1 <End_log_pos> [] +mysqld-bin.000001 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001 +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-1 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t2 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t2) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t2 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t2) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-3 +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t3 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t3) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t3 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t3) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-4 +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t4 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t4) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t4 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t4) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +connection node_2; +SELECT COUNT(*) = 2 FROM t4; +COUNT(*) = 2 +1 +SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 <Pos> Gtid_list 2 <End_log_pos> [] +mysqld-bin.000001 <Pos> Binlog_checkpoint 2 <End_log_pos> mysqld-bin.000001 +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-1 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t2 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t2) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t2 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t2) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-3 +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t3 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t3) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t3 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t3) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 2 <End_log_pos> BEGIN GTID 0-2-4 +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t4 VALUES (1) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t4) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Annotate_rows 2 <End_log_pos> INSERT INTO t4 VALUES (2) +mysqld-bin.000001 <Pos> Table_map 2 <End_log_pos> table_id: ### (test.t4) +mysqld-bin.000001 <Pos> Write_rows_v1 2 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 2 <End_log_pos> COMMIT /* xid=### */ +DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_many_fragments.result b/mysql-test/suite/galera_sr/r/galera_sr_many_fragments.result new file mode 100644 index 00000000..8c89d100 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_many_fragments.result @@ -0,0 +1,33 @@ +connection node_2; +connection node_1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(512)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('x', 512) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) = 10000 FROM t1; +COUNT(*) = 10000 +1 +connection node_1; +ROLLBACK; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT10M'; +SET SESSION wsrep_sync_wait = 7; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +COUNT(*) = 0 +1 +COUNT(*) = 0 +1 diff --git a/mysql-test/suite/galera_sr/r/galera_sr_multirow_rollback.result b/mysql-test/suite/galera_sr/r/galera_sr_multirow_rollback.result new file mode 100644 index 00000000..1795d16b --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_multirow_rollback.result @@ -0,0 +1,127 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY DEFAULT 0, f2 char(12)); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 (f2) VALUES ('a'), ('b'); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +connection node_2; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +DROP TABLE t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY DEFAULT 0, f2 char(12)); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1000; +START TRANSACTION; +INSERT INTO t1 (f2) VALUES ('a'), ('b'); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +COMMIT; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +connection node_2; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +DROP TABLE t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY DEFAULT 0, f2 char(12)); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1000; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'b'); +INSERT INTO t1 (f2) VALUES ('c'), ('d'); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +COMMIT; +expect (1,'a'), (2, 'b') +SELECT * FROM t1; +f1 f2 +1 a +2 b +connection node_2; +expect (1,'a'), (2, 'b') +SELECT * FROM t1; +f1 f2 +1 a +2 b +DROP TABLE t1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY DEFAULT 0, f2 char(12)); +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 (f2) VALUES ('a'), ('b'); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +connection node_2; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1000; +INSERT INTO t1 (f2) VALUES ('a'), ('b'); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +connection node_2; +SELECT COUNT(*) AS expect_0 FROM t1; +expect_0 +0 +DROP TABLE t1; +connection node_1; +CREATE TABLE p(id int primary key, j int) ENGINE=InnoDB; +CREATE TABLE c(id int primary key, fk1 int) ENGINE=InnoDB; +ALTER TABLE c ADD FOREIGN KEY (fk1) references p(id); +INSERT INTO p VALUES(1, 0); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO c VALUES (3,1); +INSERT INTO c VALUES (1,1), (2,2); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +SELECT * FROM p; +id j +1 0 +SELECT * FROM c; +id fk1 +connection node_2; +SELECT * FROM p; +id j +1 0 +SELECT * FROM c; +id fk1 +DROP TABLE c; +DROP TABLE p; +connection node_1; +CREATE TABLE p(id int primary key, j int) ENGINE=InnoDB; +CREATE TABLE c(id int primary key, fk1 int) ENGINE=InnoDB; +ALTER TABLE c ADD FOREIGN KEY (fk1) references p(id); +INSERT INTO p VALUES(1, 0); +SET SESSION wsrep_trx_fragment_size=1000; +START TRANSACTION; +INSERT INTO c VALUES (3,1); +INSERT INTO c VALUES (1,1), (2,2); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`c`, CONSTRAINT `c_ibfk_1` FOREIGN KEY (`fk1`) REFERENCES `p` (`id`)) +COMMIT; +SELECT * FROM p; +id j +1 0 +SELECT * FROM c; +id fk1 +3 1 +connection node_2; +SELECT * FROM p; +id j +1 0 +SELECT * FROM c; +id fk1 +3 1 +DROP TABLE c; +DROP TABLE p; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_myisam.result b/mysql-test/suite/galera_sr/r/galera_sr_myisam.result new file mode 100644 index 00000000..5f899f52 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_myisam.result @@ -0,0 +1,16 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 TEXT) ENGINE=MyISAM; +SET SESSION wsrep_trx_fragment_size = 1; +SET GLOBAL wsrep_mode = REPLICATE_MYISAM; +INSERT INTO t1 VALUES (REPEAT('x', 65535)); +connection node_2; +SELECT COUNT(*) AS EXPECT_1 FROM t1; +EXPECT_1 +1 +SELECT LENGTH(f1) = 65535 FROM t1; +LENGTH(f1) = 65535 +1 +DROP TABLE t1; +connection node_1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result b/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result new file mode 100644 index 00000000..82a9262b --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_mysqldump_sst.result @@ -0,0 +1,60 @@ +connection node_2; +connection node_1; +Setting SST method to mysqldump ... +call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to '127.0.0.1'"); +call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); +connection node_1; +CREATE USER 'sst'; +GRANT ALL PRIVILEGES ON *.* TO 'sst'; +SET GLOBAL wsrep_sst_auth = 'sst:'; +connection node_2; +SET GLOBAL wsrep_sst_method = 'mysqldump'; +connection node_1; +connection node_2; +connection node_1; +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size = 1000; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('x', 255) FROM ten AS a1, ten AS a2, ten AS a3; +UPDATE t1 SET f2 = REPEAT('y', 255); +connection node_2; +connection node_2; +Shutting down server ... +connection node_1; +connection node_2; +# restart: with restart_parameters +connection node_1; +connection node_2; +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +UPDATE t1 SET f2 = REPEAT('z', 255); +COMMIT; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +SELECT COUNT(*) = 1000 FROM t1; +COUNT(*) = 1000 +1 +SELECT COUNT(*) = 1000 FROM t1 WHERE f2 = REPEAT('z', 255); +COUNT(*) = 1000 +1 +DROP TABLE t1; +DROP TABLE ten; +connection node_1; +SET SESSION wsrep_trx_fragment_size=0; +connection node_1; +CALL mtr.add_suppression("Slave SQL: Error 'The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); +DROP USER sst; +connection node_2; +CALL mtr.add_suppression("Slave SQL: Error 'The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); +CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); +CALL mtr.add_suppression("Can't open and lock time zone table"); +CALL mtr.add_suppression("Can't open and lock privilege tables"); +CALL mtr.add_suppression("Info table is not ready to be used"); +CALL mtr.add_suppression("Native table .* has the wrong structure"); +CALL mtr.add_suppression("Table \'mysql.gtid_slave_pos\' doesn\'t exist"); diff --git a/mysql-test/suite/galera_sr/r/galera_sr_nonPK_and_PA.result b/mysql-test/suite/galera_sr/r/galera_sr_nonPK_and_PA.result new file mode 100644 index 00000000..b7e9cf49 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_nonPK_and_PA.result @@ -0,0 +1,46 @@ +connection node_2; +connection node_1; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL wsrep_slave_threads = 2; +flush status; +connection node_1; +CREATE TABLE t1 (f1 int, f2 int) ENGINE=InnoDB; +CREATE TABLE t2 (f1 int primary key, f2 int) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,0); +INSERT INTO t1 VALUES (2,0); +INSERT INTO t2 VALUES (1,0); +INSERT INTO t2 VALUES (2,0); +connection node_2; +connection node_1; +set session wsrep_trx_fragment_size=1; +START TRANSACTION; +UPDATE t1 SET f2=1 where f1=1; +connection node_2; +distance +1 +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_slave_enter_sync'; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +update t2 set f2=1 where f1=1; +connection node_2; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_1; +UPDATE t2 set f2=2 where f1=2; +connection node_2; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_1; +COMMIT; +connection node_1; +SET GLOBAL wsrep_slave_threads = DEFAULT; +DROP TABLE t1; +DROP TABLE t2; +connection node_2; +SET GLOBAL wsrep_slave_threads = DEFAULT; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_parallel_apply.result b/mysql-test/suite/galera_sr/r/galera_sr_parallel_apply.result new file mode 100644 index 00000000..e2194e08 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_parallel_apply.result @@ -0,0 +1,37 @@ +connection node_2; +connection node_1; +connection node_2; +SET GLOBAL wsrep_slave_threads = 5; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) VALUES (1); +INSERT INTO t1 (f2) VALUES (1); +INSERT INTO t1 (f2) VALUES (1); +INSERT INTO t1 (f2) VALUES (1); +INSERT INTO t1 (f2) VALUES (1);; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) VALUES (2); +INSERT INTO t1 (f2) VALUES (2); +INSERT INTO t1 (f2) VALUES (2); +INSERT INTO t1 (f2) VALUES (2); +INSERT INTO t1 (f2) VALUES (2);; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +COMMIT; +connection node_1a; +ROLLBACK; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +SELECT COUNT(*) = 5 FROM t1; +COUNT(*) = 5 +1 +connection node_1; +DROP TABLE t1; +connection node_2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_rollback.result b/mysql-test/suite/galera_sr/r/galera_sr_rollback.result new file mode 100644 index 00000000..4b275c6e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_rollback.result @@ -0,0 +1,42 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER, f2 VARCHAR(10)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +INSERT INTO t1 VALUES (3, 'a'); +INSERT INTO t1 VALUES (4, 'a'); +INSERT INTO t1 VALUES (5, 'a'); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +INSERT INTO t1 VALUES (11, 'b'); +INSERT INTO t1 VALUES (12, 'b'); +INSERT INTO t1 VALUES (13, 'b'); +INSERT INTO t1 VALUES (14, 'b'); +INSERT INTO t1 VALUES (15, 'b'); +connection node_2; +connection node_1; +ROLLBACK; +connection node_2; +connection node_1; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +INSERT INTO t1 VALUES (3, 'a'); +INSERT INTO t1 VALUES (4, 'a'); +INSERT INTO t1 VALUES (5, 'a'); +INSERT INTO t1 VALUES (11, 'b'); +INSERT INTO t1 VALUES (12, 'b'); +INSERT INTO t1 VALUES (13, 'b'); +INSERT INTO t1 VALUES (14, 'b'); +INSERT INTO t1 VALUES (15, 'b'); +connection node_2; +connection node_1; +COMMIT; +connection node_2; +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_rollback_retry.result b/mysql-test/suite/galera_sr/r/galera_sr_rollback_retry.result new file mode 100644 index 00000000..1117a50d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_rollback_retry.result @@ -0,0 +1,34 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +connection node_1; +ROLLBACK; +connection node_2; +SELECT * FROM t1; +f1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +COMMIT; +SELECT COUNT(*) AS EXPECT_5 FROM t1; +EXPECT_5 +5 +connection node_1; +SELECT COUNT(*) AS EXPECT_5 FROM t1; +EXPECT_5 +5 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_rollback_savepoint.result b/mysql-test/suite/galera_sr/r/galera_sr_rollback_savepoint.result new file mode 100644 index 00000000..9db548c1 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_rollback_savepoint.result @@ -0,0 +1,42 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER, f2 VARCHAR(10)) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +INSERT INTO t1 VALUES (3, 'a'); +INSERT INTO t1 VALUES (4, 'a'); +INSERT INTO t1 VALUES (5, 'a'); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +SAVEPOINT s1; +INSERT INTO t1 VALUES (11, 'b'); +INSERT INTO t1 VALUES (12, 'b'); +INSERT INTO t1 VALUES (13, 'b'); +INSERT INTO t1 VALUES (14, 'b'); +INSERT INTO t1 VALUES (15, 'b'); +connection node_2; +connection node_1; +ROLLBACK TO SAVEPOINT s1; +INSERT INTO t1 VALUES (21, 'c'); +INSERT INTO t1 VALUES (22, 'c'); +INSERT INTO t1 VALUES (23, 'c'); +INSERT INTO t1 VALUES (24, 'c'); +INSERT INTO t1 VALUES (25, 'c'); +connection node_2; +SELECT COUNT(*) = 5 FROM t1 WHERE f2 = 'a'; +COUNT(*) = 5 +1 +SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'b'; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 5 FROM t1 WHERE f2 = 'c'; +COUNT(*) = 5 +1 +connection node_1; +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_rollback_statement.result b/mysql-test/suite/galera_sr/r/galera_sr_rollback_statement.result new file mode 100644 index 00000000..ce3214af --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_rollback_statement.result @@ -0,0 +1,33 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'); +INSERT INTO t2 VALUES (3, 'b'); +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t2 SELECT * FROM t1; +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +last_committed_diff +3 +connection node_2; +connection node_1; +INSERT INTO t2 VALUES (1, 'c'); +connection node_2; +INSERT INTO t2 VALUES (2, 'c'); +connection node_1; +SELECT * FROM t2; +f1 f2 +1 c +2 c +3 b +connection node_2; +SELECT * FROM t2; +f1 f2 +1 c +2 c +3 b +connection node_1; +SET SESSION wsrep_trx_fragment_size = DEFAULT; +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_shutdown_master.result b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_master.result new file mode 100644 index 00000000..051b9d6b --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_master.result @@ -0,0 +1,32 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE = InnoDB; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1),(2),(3); +connection node_1; +connection node_2; +connection node_1; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_2; +# restart +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +INSERT INTO t1 VALUES (1),(2),(3); +connection node_1; +SELECT COUNT(*) = 3 FROM t1; +COUNT(*) = 3 +1 +DROP TABLE t1; +connection node_2; +CALL mtr.add_suppression("WSREP: Failed to replicate rollback fragment for "); diff --git a/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result new file mode 100644 index 00000000..34995d35 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result @@ -0,0 +1,48 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; +call mtr.add_suppression("WSREP: Failed to scan the last segment to the end. Last events may be missing. Last recovered event:.*"); +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE = InnoDB; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (11),(12),(13); +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1b; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (21),(22),(23); +connection node_2; +connection node_1; +connection node_1a; +INSERT INTO t1 VALUES (14),(15),(16); +COMMIT; +connection node_2; +# restart +SELECT COUNT(*) > 0 FROM mysql.wsrep_streaming_log; +COUNT(*) > 0 +1 +SELECT COUNT(*) AS EXPECT_6 FROM t1 WHERE f1 IN (11,12,13,14,15,16); +EXPECT_6 +6 +connection node_1b; +INSERT INTO t1 VALUES (24),(25),(26); +COMMIT; +connection node_2; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_12 FROM t1; +EXPECT_12 +12 +connection node_1; +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_slow.result b/mysql-test/suite/galera_sr/r/galera_sr_slow.result new file mode 100644 index 00000000..a03aac0d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_slow.result @@ -0,0 +1,13 @@ +connection node_2; +connection node_1; +connection node_1; +SET GLOBAL wsrep_trx_fragment_unit='bytes'; +SET GLOBAL wsrep_trx_fragment_size=10240000; +SET GLOBAL slow_query_log=ON; +SET GLOBAL log_output='TABLE'; +SELECT SLEEP(10); +SLEEP(10) +0 +SET GLOBAL wsrep_trx_fragment_unit=DEFAULT; +SET GLOBAL wsrep_trx_fragment_size=DEFAULT; +SET GLOBAL log_output=DEFAULT; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_small_gcache.result b/mysql-test/suite/galera_sr/r/galera_sr_small_gcache.result new file mode 100644 index 00000000..875f2df5 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_small_gcache.result @@ -0,0 +1,15 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +connection node_2; +SELECT COUNT(*) = 10000 FROM t1; +COUNT(*) = 10000 +1 +connection node_1; +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_transaction_replay.result b/mysql-test/suite/galera_sr/r/galera_sr_transaction_replay.result new file mode 100644 index 00000000..5806ab55 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_transaction_replay.result @@ -0,0 +1,121 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait = 0; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; +f1 f2 +2 a +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +UPDATE t1 SET f2 = 'c' WHERE f1 = 2; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; +connection node_1; +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +wsrep_local_replays +1 +connection node_2; +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DELETE FROM t1; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +connection node_1; +SET AUTOCOMMIT=ON; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +UPDATE t1 SET f2 = 'x' WHERE f1 = 1; +SET SESSION wsrep_trx_fragment_size = 0; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; +f1 f2 +2 a +connection node_1a; +SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync'; +connection node_2; +UPDATE t1 SET f2 = 'c' WHERE f1 = 2; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,local_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_sync_wait = 0; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end'; +SET GLOBAL wsrep_provider_options = 'signal=local_monitor_master_enter_sync'; +connection node_1; +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +wsrep_local_replays +1 +connection node_2; +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DELETE FROM t1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_unit_statements.result b/mysql-test/suite/galera_sr/r/galera_sr_unit_statements.result new file mode 100644 index 00000000..4e3bd524 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_unit_statements.result @@ -0,0 +1,54 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 3; +SET SESSION wsrep_trx_fragment_unit = 'statements'; +connection node_1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) FROM t1; +COUNT(*) +0 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_1; +INSERT INTO t1 VALUES (2); +connection node_2; +SELECT COUNT(*) FROM t1; +COUNT(*) +2 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +1 +connection node_1; +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +2 +connection node_1; +COMMIT; +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +connection node_2; +SELECT COUNT(*) FROM t1; +COUNT(*) +5 +SELECT COUNT(*) FROM mysql.wsrep_streaming_log; +COUNT(*) +0 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_v1_row_events.result b/mysql-test/suite/galera_sr/r/galera_sr_v1_row_events.result new file mode 100644 index 00000000..ab090e5c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_v1_row_events.result @@ -0,0 +1,20 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +connection node_1; +COMMIT; +SET AUTOCOMMIT=ON; +UPDATE t1 SET f1 = 2 WHERE f1 = 1; +connection node_2; +SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +COUNT(*) = 1 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ws_size.result b/mysql-test/suite/galera_sr/r/galera_sr_ws_size.result new file mode 100644 index 00000000..b7bdd94d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ws_size.result @@ -0,0 +1,36 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(254)) ENGINE=InnoDB; +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +SET SESSION wsrep_trx_fragment_size = 512; +SET GLOBAL wsrep_provider_options='repl.max_ws_size=4096'; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +COMMIT; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT COUNT(*) = 100 FROM t1; +COUNT(*) = 100 +1 +DROP TABLE t1; +DROP TABLE ten; +connection node_1; +call mtr.add_suppression('WSREP: transaction size limit.*'); +call mtr.add_suppression('WSREP: rbr write fail.*'); +call mtr.add_suppression('WSREP: Maximum writeset size exceeded by.*'); +call mtr.add_suppression('WSREP: transaction size exceeded.*'); diff --git a/mysql-test/suite/galera_sr/r/galera_sr_ws_size2.result b/mysql-test/suite/galera_sr/r/galera_sr_ws_size2.result new file mode 100644 index 00000000..6bd8b6b8 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_sr_ws_size2.result @@ -0,0 +1,34 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(254)) ENGINE=InnoDB; +CREATE TABLE ten (f1 INTEGER); +INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +SET SESSION wsrep_trx_fragment_size = 256; +SET GLOBAL wsrep_provider_options='repl.max_ws_size=128'; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 (f2) SELECT REPEAT('x', 254) FROM ten AS a1, ten AS a2; +Got one of the listed errors +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +DROP TABLE t1; +DROP TABLE ten; +call mtr.add_suppression('WSREP: SR rollback replication failure.*'); +call mtr.add_suppression('WSREP: transaction size limit.*'); +call mtr.add_suppression('WSREP: SR rbr write fail.*'); +call mtr.add_suppression('WSREP: Maximum writeset size exceeded by.*'); +call mtr.add_suppression('WSREP: transaction size exceeded.*'); +call mtr.add_suppression('WSREP: fragment replication failed:'); +call mtr.add_suppression('WSREP: post commit failed for SR rollback'); +call mtr.add_suppression('WSREP: pre_commit for SR rollback returned 2, thd:*'); +call mtr.add_suppression('WSREP: wsrep_rollback failed to send SR ROLLBACK for *'); diff --git a/mysql-test/suite/galera_sr/r/galera_var_ignore_apply_errors_sr.result b/mysql-test/suite/galera_sr/r/galera_var_ignore_apply_errors_sr.result new file mode 100644 index 00000000..85220843 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/galera_var_ignore_apply_errors_sr.result @@ -0,0 +1,29 @@ +connection node_2; +connection node_1; +connection node_2; +SET GLOBAL wsrep_ignore_apply_errors = 2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER); +INSERT INTO t1 VALUES (2); +SET GLOBAL wsrep_on = OFF; +INSERT INTO t1 VALUES (1); +SET GLOBAL wsrep_on = ON; +SET SESSION wsrep_trx_fragment_size = 1; +START TRANSACTION; +INSERT INTO t1 VALUES (3); +DELETE FROM t1 WHERE f1 = 1; +DELETE FROM t1 WHERE f1 = 2; +COMMIT; +connection node_1; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SET SESSION wsrep_trx_fragment_size = 0; +DROP TABLE t1; +SET GLOBAL wsrep_ignore_apply_errors = 7; +CALL mtr.add_suppression("Slave SQL: Could not execute Delete_rows event"); +CALL mtr.add_suppression("Can't find record in 't1'"); diff --git a/mysql-test/suite/galera_sr/r/mdev_18631.result b/mysql-test/suite/galera_sr/r/mdev_18631.result new file mode 100644 index 00000000..779ae526 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mdev_18631.result @@ -0,0 +1,22 @@ +connection node_2; +connection node_1; +# On node_1 +connection node_1; +CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=INNODB; +INSERT INTO t1 VALUES (1), (2), (3); +connection node_2; +call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node."); +SELECT * FROM t1; +f1 +1 +2 +3 +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +3 +DROP TABLE t1; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep#215.result b/mysql-test/suite/galera_sr/r/mysql-wsrep#215.result new file mode 100644 index 00000000..623bef4c --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep#215.result @@ -0,0 +1,137 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 2; +SET SESSION wsrep_trx_fragment_unit = 'statements'; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_1a; +SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_apply_cb'; +SET SESSION wsrep_sync_wait = 0; +connection node_2; +INSERT INTO t1 VALUES (1); +connection node_1a; +SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +INSERT INTO t1 VALUES (1);; +connection node_1a; +connection node_1a; +SET GLOBAL DEBUG_DBUG = ''; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1a; +SET DEBUG_SYNC = 'RESET'; +connection node_1; +TRUNCATE TABLE t1; +SET SESSION wsrep_trx_fragment_size = 10; +SET SESSION wsrep_trx_fragment_unit = 'bytes'; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_1a; +SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_apply_cb'; +SET SESSION wsrep_sync_wait = 0; +connection node_2; +INSERT INTO t1 VALUES (1); +connection node_1a; +SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +INSERT INTO t1 VALUES (1); +connection node_1a; +SET GLOBAL DEBUG_DBUG = ''; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +ROLLBACK; +SELECT * FROM t1; +f1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT * FROM t1; +f1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1a; +SET DEBUG_SYNC = 'RESET'; +connection node_1; +TRUNCATE TABLE t1; +SET SESSION wsrep_trx_fragment_size = 200; +SET SESSION wsrep_trx_fragment_unit = 'bytes'; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +SET AUTOCOMMIT=OFF; +START TRANSACTION; +connection node_1a; +SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_apply_cb'; +SET SESSION wsrep_sync_wait = 0; +connection node_2; +INSERT INTO t1 VALUES (1); +connection node_1a; +SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +connection node_1a; +SET GLOBAL DEBUG_DBUG = ''; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +connection node_1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 1 FROM t1; +COUNT(*) = 1 +1 +SELECT COUNT(*) = 0 FROM mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_1a; +DROP TABLE t1; +SET DEBUG_SYNC = 'RESET'; +connection node_2; +CALL mtr.add_suppression("WSREP: Could not find applier context for"); diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-bugs-900.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-bugs-900.result new file mode 100644 index 00000000..a51b5299 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-bugs-900.result @@ -0,0 +1,15 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +SET SESSION wsrep_cluster_name = ' '; +ERROR HY000: Variable 'wsrep_cluster_name' is a GLOBAL variable and should be set with SET GLOBAL +INSERT INTO t1 VALUES (2); +COMMIT; +SELECT f1 AS expect_1_and_2 FROM t1; +expect_1_and_2 +1 +2 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#136.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#136.result new file mode 100644 index 00000000..84246a8e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#136.result @@ -0,0 +1,63 @@ +connection node_2; +connection node_1; +connection node_1; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; +SET GLOBAL wsrep_on=ON; +connection node_2; +SET GLOBAL wsrep_on=OFF; +RESET MASTER; +SET GLOBAL wsrep_on=ON; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2); +COMMIT; +SET SESSION wsrep_trx_fragment_size = 0; +INSERT INTO t1 VALUES (3),(4); +COMMIT; +connection node_1; +SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 <Pos> Gtid_list 1 <End_log_pos> [] +mysqld-bin.000001 <Pos> Binlog_checkpoint 1 <End_log_pos> mysqld-bin.000001 +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1 +mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1),(2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-3 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (3),(4) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +connection node_2; +SELECT COUNT(*) = 4 FROM t1; +COUNT(*) = 4 +1 +SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256; +Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 <Pos> Gtid_list 2 <End_log_pos> [] +mysqld-bin.000001 <Pos> Binlog_checkpoint 2 <End_log_pos> mysqld-bin.000001 +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> GTID 0-1-1 +mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-2 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (1),(2) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +mysqld-bin.000001 <Pos> Gtid 1 <End_log_pos> BEGIN GTID 0-1-3 +mysqld-bin.000001 <Pos> Annotate_rows 1 <End_log_pos> INSERT INTO t1 VALUES (3),(4) +mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1) +mysqld-bin.000001 <Pos> Write_rows_v1 1 <End_log_pos> table_id: ### flags: STMT_END_F +mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */ +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#138.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#138.result new file mode 100644 index 00000000..fc9afd6e --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#138.result @@ -0,0 +1,24 @@ +connection node_2; +connection node_1; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1),(2); +connection node_2; +SELECT flags FROM mysql.wsrep_streaming_log; +flags +1 +0 +connection node_1; +ROLLBACK; +INSERT INTO t1 VALUES (3),(4); +connection node_2; +SELECT flags FROM mysql.wsrep_streaming_log; +flags +1 +0 +connection node_1; +ROLLBACK; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#14.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#14.result new file mode 100644 index 00000000..b09c7d40 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#14.result @@ -0,0 +1,12 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +COMMIT; +DROP TABLE t1; +connection node_2; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result new file mode 100644 index 00000000..98bf13e9 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result @@ -0,0 +1,39 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO t2 VALUES (6),(7),(8),(9),(10),(1); +connection node_2; +SET GLOBAL wsrep_slave_threads = 2; +SET GLOBAL debug_dbug = 'd,sync.wsrep_apply_cb'; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1), (2), (3), (4), (5);; +connection node_1; +INSERT INTO t1 SELECT * FROM t2;; +connection node_1a; +INSERT INTO t1 VALUES (6), (7), (8), (9), (10); +COMMIT; +connection node_1; +Got one of the listed errors +connection node_2; +SET GLOBAL wsrep_slave_threads = 1; +SET GLOBAL debug_dbug = ''; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +SET DEBUG_SYNC='now SIGNAL signal.wsrep_apply_cb'; +SELECT COUNT(*) = 10 FROM t1; +COUNT(*) = 10 +1 +DROP TABLE t1; +DROP TABLE t2; +SET DEBUG_SYNC = RESET; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#15.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#15.result new file mode 100644 index 00000000..610019e2 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#15.result @@ -0,0 +1,11 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (id INT) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#165.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#165.result new file mode 100644 index 00000000..8ad3ac63 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#165.result @@ -0,0 +1,1045 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1, 'x'), (2, 'x'), (4, 'x'), (5, 'x'); +connection node_1a; +START TRANSACTION; +UPDATE t1 SET f2 = 'a' WHERE f1 = 1; +UPDATE t1 SET f2 = 'a' WHERE f1 = 4; +UPDATE t1 SET f2 = 'a' WHERE f1 = 5; +connection node_1b; +START TRANSACTION; +SET SESSION wsrep_trx_fragment_size = 1; +INSERT INTO t1 VALUES (3, 'b'); +UPDATE t1 SET f2 = 'b' WHERE f1 = 2; +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1c; +SET AUTOCOMMIT=ON; +INSERT INTO t1 VALUES (3, 'c'); +connection node_2; +SELECT * FROM t1; +f1 f2 +1 x +2 x +4 x +5 x +connection node_1a; +UPDATE t1 SET f2 = 'a' WHERE f1 = 2; +connection node_1; +connection node_1b; +SET DEBUG_SYNC = 'wsrep_before_SR_rollback SIGNAL wait WAIT_FOR continue'; +UPDATE t1 SET f2 = 'b' WHERE f1 = 1; +connection node_1; +SET DEBUG_SYNC = 'now WAIT_FOR wait'; +connection node_1; +SET DEBUG_SYNC = 'now SIGNAL continue'; +connection node_1c; +UPDATE t1 SET f2 = 'x' WHERE f1 = 3; +connection node_1a; +COMMIT; +connection node_1b; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +connection node_1; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_2; +SELECT * FROM t1; +f1 f2 +1 a +2 a +3 x +4 a +5 a +connection node_1; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#22.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#22.result new file mode 100644 index 00000000..1215f334 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#22.result @@ -0,0 +1,35 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER, f2 VARCHAR(10)) ENGINE=InnoDB; +SET AUTOCOMMIT=OFF; +SET SESSION wsrep_trx_fragment_size=1; +START TRANSACTION; +INSERT INTO t1 VALUES (1, 'a'); +INSERT INTO t1 VALUES (2, 'a'); +INSERT INTO t1 VALUES (3, 'a'); +INSERT INTO t1 VALUES (4, 'a'); +INSERT INTO t1 VALUES (5, 'a'); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +connection node_1; +SAVEPOINT s1; +INSERT INTO t1 VALUES (11, 'b'); +INSERT INTO t1 VALUES (12, 'b'); +INSERT INTO t1 VALUES (13, 'b'); +INSERT INTO t1 VALUES (14, 'b'); +INSERT INTO t1 VALUES (15, 'b'); +connection node_2; +connection node_1; +ROLLBACK TO SAVEPOINT s1; +INSERT INTO t1 VALUES (21, 'c'); +COMMIT; +connection node_1; +SELECT COUNT(*) = 6 FROM t1; +COUNT(*) = 6 +1 +connection node_2; +SELECT COUNT(*) = 6 FROM t1; +COUNT(*) = 6 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#27.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#27.result new file mode 100644 index 00000000..4cbcd49d --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#27.result @@ -0,0 +1,23 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +connection node_1; +COMMIT; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#32.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#32.result new file mode 100644 index 00000000..ca749a45 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#32.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SET AUTOCOMMIT=OFF; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION; +INSERT INTO t1 VALUES (9); +INSERT INTO t1 VALUES (8); +INSERT INTO t1 VALUES (7); +INSERT INTO t1 VALUES (6); +INSERT INTO t1 VALUES (5); +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +ROLLBACK; +connection node_1; +COMMIT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result new file mode 100644 index 00000000..3f463875 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#35.result @@ -0,0 +1,37 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SET SESSION wsrep_sync_wait = 0; +SET GLOBAL debug_dbug = '+d,sync.wsrep_apply_cb'; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +INSERT INTO t1 VALUES (3); +INSERT INTO t1 VALUES (4); +INSERT INTO t1 VALUES (5); +connection node_2a; +SET SESSION debug_sync = "now WAIT_FOR sync.wsrep_apply_cb_reached"; +connection node_2; +SET SESSION wsrep_sync_wait = 0; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +INSERT INTO t1 VALUES (1);; +connection node_1; +COMMIT; +connection node_2a; +SET GLOBAL debug_dbug = ''; +SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; +connection node_2; +Got one of the listed errors +ROLLBACK; +DROP TABLE t1; +connection node_2a; +SET DEBUG_SYNC = "RESET"; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#8.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#8.result new file mode 100644 index 00000000..56905c03 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#8.result @@ -0,0 +1,39 @@ +connection node_2; +connection node_1; +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; +INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; +connection node_2; +SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'; +COUNT(*) = 13 +1 +connection node_1; +INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +connection node_2; +SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz'); +COUNT(f2) = 10000 +1 +UPDATE t1 SET f2 = 'abcdefjhk'; +connection node_1; +SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk'); +COUNT(f2) = 10000 +1 +connection node_2; +DROP TABLE t1; +connection node_1; +CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB; +connection node_2; +INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +connection node_1; +SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz'); +COUNT(f1) = 1000 +1 +UPDATE t1 SET f1 = 'abcdefjhk'; +connection node_2; +SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); +COUNT(f1) = 1000 +1 +DROP TABLE t1; +DROP TABLE ten; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#9.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#9.result new file mode 100644 index 00000000..312c8efc --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#9.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +connection node_1; +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; +SET SESSION wsrep_trx_fragment_size = 1; +CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; +connection node_2; +Killing server ... +connection node_1; +ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_2; +# restart +connection node_2a; +SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1'; +COUNT(*) = 2 +1 +SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE = 2 +1 +connection node_1; +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#93.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#93.result new file mode 100644 index 00000000..17f71213 --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#93.result @@ -0,0 +1,18 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER); +SET SESSION WSREP_TRX_FRAGMENT_SIZE=1; +START TRANSACTION; +SAVEPOINT a; +INSERT INTO t1 VALUES (1); +ROLLBACK TO SAVEPOINT a; +INSERT INTO t1 values (2); +COMMIT; +SELECT COUNT(*) = 0 from mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +connection node_2; +SELECT COUNT(*) = 0 from mysql.wsrep_streaming_log; +COUNT(*) = 0 +1 +DROP TABLE t1; diff --git a/mysql-test/suite/galera_sr/r/mysql-wsrep-features#96.result b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#96.result new file mode 100644 index 00000000..dbe91aad --- /dev/null +++ b/mysql-test/suite/galera_sr/r/mysql-wsrep-features#96.result @@ -0,0 +1,33 @@ +connection node_2; +connection node_1; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t2 (f2 VARCHAR(32)); +SET SESSION wsrep_trx_fragment_size=1; +SET AUTOCOMMIT=OFF; +START TRANSACTION; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2),(1); +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +INSERT INTO t2 VALUES ('abc'); +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 1 FROM t2; +COUNT(*) = 1 +1 +connection node_1; +ROLLBACK; +connection node_2; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +SELECT COUNT(*) = 0 FROM t2; +COUNT(*) = 0 +1 +connection node_1; +DROP TABLE t1; +DROP TABLE t2; |