diff options
author | Brave Galera Crew <devel@codership.com> | 2019-01-23 15:30:00 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-01-23 15:30:00 +0400 |
commit | 36a2a185fe18d31a644da46cfabd9757a379280c (patch) | |
tree | 00ca186ce2cfdc3ab7e4979336a384e2b51c5aa9 /mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test | |
parent | 382115b99297ceaa4c3067f79efb5c2515013be5 (diff) | |
download | mariadb-git-36a2a185fe18d31a644da46cfabd9757a379280c.tar.gz |
Galera4
Diffstat (limited to 'mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test')
-rw-r--r-- | mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test b/mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test new file mode 100644 index 00000000000..0ea52290bb6 --- /dev/null +++ b/mysql-test/suite/galera_sr/t/galera_sr_conflict_on_commit2.test @@ -0,0 +1,46 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +# +# Test the following sequence of events: +# +# 1. Node #1 begins a transaction that is SR replicated +# 2. Node #2 begins a conflicting transaction, hangs +# 3. Node #1 comits +# 4. Node #2 gets a dup key error +# + +--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 +--send INSERT INTO t1 VALUES (5); + +--sleep 1 + +--connection node_1 +COMMIT; + +--connection node_2 +--error ER_DUP_ENTRY +--reap + +SELECT COUNT(*) = 5 FROM t1; + +--connection node_2 +SELECT COUNT(*) = 5 FROM t1; + +--connection node_1 +DROP TABLE t1; |