Skip to content
Permalink
Browse files

MDEV-18832 Galera: 10.4 node crashed with Assertion `state() == s_com…

…mitting' if you create SEQUENCE, use it, then drop and recreate and use again (#1339)

We could still end committing to binlog even in rollback.
Do not proceed with WSREP commit in this case.
  • Loading branch information...
mkaruza authored and janlindstrom committed Jun 18, 2019
1 parent e85e481 commit 48570eb65cee840be46497c8411a147280e404c5
@@ -0,0 +1,14 @@
connection node_2;
connection node_1;
CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1;
CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id));
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
DROP SEQUENCE Seq1_1;
CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1;
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP SEQUENCE Seq1_1;
DROP TABLE t1;
@@ -0,0 +1,4 @@
!include ../galera_2nodes.cnf

[mysqld]
log-bin
@@ -0,0 +1,15 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1;
CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id));
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
DROP SEQUENCE Seq1_1;
CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1;
--error ER_DUP_ENTRY
INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1);
DROP SEQUENCE Seq1_1;
DROP TABLE t1;
@@ -193,6 +193,8 @@ static inline bool wsrep_run_commit_hook(THD* thd, bool all)
wsrep_is_ordered(thd)));
/* Is MST commit or autocommit? */
bool ret= wsrep_is_active(thd) && wsrep_is_real(thd, all);
/* Do not commit if we are aborting */
ret= ret && (thd->wsrep_trx().state() != wsrep::transaction::s_aborting);
if (ret && !(wsrep_has_changes(thd) || /* Has generated write set */
/* Is high priority (replay, applier, storage) and the
transaction is scheduled for commit ordering */

0 comments on commit 48570eb

Please sign in to comment.
You can’t perform that action at this time.