Skip to content

Commit

Permalink
MDEV-25562 Assertion `pause_seqno_.is_undefined() == false' failed in…
Browse files Browse the repository at this point in the history
… void wsrep::server_state::resume()

If pause() is not executed in galera and returns seqno = -1 we should
skip resume().
  • Loading branch information
mkaruza authored and Jan Lindström committed May 21, 2021
1 parent 08b6fd9 commit 5667baa
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
16 changes: 16 additions & 0 deletions mysql-test/suite/galera/r/MDEV-25562.result
Original file line number Diff line number Diff line change
@@ -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;
23 changes: 23 additions & 0 deletions mysql-test/suite/galera/t/MDEV-25562.test
Original file line number Diff line number Diff line change
@@ -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;

7 changes: 4 additions & 3 deletions sql/lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 5667baa

Please sign in to comment.