diff options
author | mkaruza <mario.karuza@galeracluster.com> | 2021-05-20 09:56:53 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-05-21 10:35:17 +0300 |
commit | 5667baad5d7a597d56786e6872da79696e511149 (patch) | |
tree | 956e043faccaaaf92a9d8573ff521c3ab4d7851b | |
parent | 08b6fd93957280c1b3e12c30ead1b6b90a7dff26 (diff) | |
download | mariadb-git-5667baad5d7a597d56786e6872da79696e511149.tar.gz |
MDEV-25562 Assertion `pause_seqno_.is_undefined() == false' failed in void wsrep::server_state::resume()
If pause() is not executed in galera and returns seqno = -1 we should
skip resume().
-rw-r--r-- | mysql-test/suite/galera/r/MDEV-25562.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/galera/t/MDEV-25562.test | 23 | ||||
-rw-r--r-- | sql/lock.cc | 7 |
3 files changed, 43 insertions, 3 deletions
diff --git a/mysql-test/suite/galera/r/MDEV-25562.result b/mysql-test/suite/galera/r/MDEV-25562.result new file mode 100644 index 00000000000..b0d77af374b --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-25562.result @@ -0,0 +1,16 @@ +connection node_2; +connection node_1; +SET SESSION WSREP_ON=0; +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +SET SESSION WSREP_ON=1; +UNLOCK TABLES; +SET GLOBAL wsrep_ignore_apply_errors=1; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +ERROR 42S01: Table 't1' already exists +SHOW PROCEDURE STATUS WHERE db = 'test'; +Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation +SET GLOBAL read_only=1; +SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +SET GLOBAL read_only=DEFAULT; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-25562.test b/mysql-test/suite/galera/t/MDEV-25562.test new file mode 100644 index 00000000000..01729936b08 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-25562.test @@ -0,0 +1,23 @@ +# +# MDEV-25562 Assertion `pause_seqno_.is_undefined() == false' failed in void wsrep::server_state::resume() +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc + +SET SESSION WSREP_ON=0; +FLUSH TABLES WITH READ LOCK AND DISABLE CHECKPOINT; +SET SESSION WSREP_ON=1; +UNLOCK TABLES; + +SET GLOBAL wsrep_ignore_apply_errors=1; +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +--error ER_TABLE_EXISTS_ERROR +CREATE TABLE t1 (a CHAR(1)) engine=innodb; +SHOW PROCEDURE STATUS WHERE db = 'test'; +SET GLOBAL read_only=1; + +SET GLOBAL wsrep_ignore_apply_errors=DEFAULT; +SET GLOBAL read_only=DEFAULT; +DROP TABLE t1; + diff --git a/sql/lock.cc b/sql/lock.cc index 3a2001fbc34..74cfa5d7c97 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1102,21 +1102,22 @@ void Global_read_lock::unlock_global_read_lock(THD *thd) thd->mdl_context.release_lock(m_mdl_global_read_lock); #ifdef WITH_WSREP - if (m_state == GRL_ACQUIRED_AND_BLOCKS_COMMIT) + if (m_state == GRL_ACQUIRED_AND_BLOCKS_COMMIT && + wsrep_locked_seqno != WSREP_SEQNO_UNDEFINED) { Wsrep_server_state& server_state= Wsrep_server_state::instance(); if (server_state.state() == Wsrep_server_state::s_donor || (WSREP_NNULL(thd) && server_state.state() != Wsrep_server_state::s_synced)) { - /* TODO: maybe redundant here?: */ - wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; server_state.resume(); + wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; } else if (WSREP_NNULL(thd) && server_state.state() == Wsrep_server_state::s_synced) { server_state.resume_and_resync(); + wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; } } #endif /* WITH_WSREP */ |