mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 00:54:30 +02:00
MDEV-33928 : Assertion failure on wsrep_thd_is_aborting
Problem was assertion assuming we always hold THD::LOCK_thd_data mutex that is not true. In most cases this is true but function is also used from InnoDB lock manager and there we can't take THD::LOCK_thd_data to obey mutex ordering. Removed assertion as wsrep transaction state can't change even that case. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
parent
4aeba2590b
commit
a2fee2da0b
1 changed files with 22 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 2018-2023 Codership Oy <info@codership.com>
|
/* Copyright 2018-2024 Codership Oy <info@codership.com>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -283,10 +283,28 @@ extern "C" my_bool wsrep_thd_order_before(const THD *left, const THD *right)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Check if wsrep transaction is aborting state.
|
||||||
|
|
||||||
|
Calling function should make sure that wsrep transaction state
|
||||||
|
can't change during this function.
|
||||||
|
|
||||||
|
This function is called from
|
||||||
|
wsrep_abort_thd where we hold THD::LOCK_thd_data
|
||||||
|
wsrep_handle_mdl_conflict we hold THD::LOCK_thd_data
|
||||||
|
wsrep_assert_no_bf_bf_wait we hold lock_sys.latch
|
||||||
|
innobase_kill_query we hold THD::LOCK_thd_data (THD::awake_no_mutex)
|
||||||
|
|
||||||
|
@param thd thread handle
|
||||||
|
|
||||||
|
@return true if wsrep transaction is aborting
|
||||||
|
@return false if not
|
||||||
|
|
||||||
|
*/
|
||||||
extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
|
extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
|
||||||
{
|
{
|
||||||
const wsrep::client_state& cs(thd->wsrep_cs());
|
const wsrep::client_state& cs(thd->wsrep_cs());
|
||||||
const enum wsrep::transaction::state tx_state(cs.transaction().state());
|
const enum wsrep::transaction::state tx_state(cs.transaction().state());
|
||||||
|
|
||||||
switch (tx_state)
|
switch (tx_state)
|
||||||
{
|
{
|
||||||
case wsrep::transaction::s_must_abort:
|
case wsrep::transaction::s_must_abort:
|
||||||
|
|
@ -296,8 +314,10 @@ extern "C" my_bool wsrep_thd_is_aborting(const MYSQL_THD thd)
|
||||||
case wsrep::transaction::s_aborted:
|
case wsrep::transaction::s_aborted:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline enum wsrep::key::type
|
static inline enum wsrep::key::type
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue