mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
MDEV-4223: Galera: InnoDB assertion failure !mutex_own(mutex) in file sync0sync.ic line 207
Analysis: Code acquired kernel_mutex when calling wsrep_innobase_kill_one_trx. However, functions below also might take kernel mutex thus the assertion. Fix: Acquire kernel_mutex only for lock_cancel_waiting_and_release where it is really needed.
This commit is contained in:
@@ -12662,7 +12662,9 @@ wsrep_innobase_kill_one_trx(void *bf_thd_ptr, trx_t *bf_trx, trx_t *victim_trx,
|
||||
if (wait_lock) {
|
||||
WSREP_DEBUG("canceling wait lock");
|
||||
victim_trx->was_chosen_as_deadlock_victim= TRUE;
|
||||
mutex_enter(&kernel_mutex);
|
||||
lock_cancel_waiting_and_release(wait_lock);
|
||||
mutex_exit(&kernel_mutex);
|
||||
}
|
||||
|
||||
wsrep_thd_awake(bf_thd, thd, signal);
|
||||
@@ -12753,10 +12755,8 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
|
||||
|
||||
if (victim_trx)
|
||||
{
|
||||
mutex_enter(&kernel_mutex);
|
||||
int rcode = wsrep_innobase_kill_one_trx(
|
||||
bf_thd, bf_trx, victim_trx, signal);
|
||||
mutex_exit(&kernel_mutex);
|
||||
wsrep_srv_conc_cancel_wait(victim_trx);
|
||||
DBUG_RETURN(rcode);
|
||||
} else {
|
||||
|
||||
@@ -13985,7 +13985,9 @@ wsrep_innobase_kill_one_trx(trx_t *bf_trx, trx_t *victim_trx, ibool signal)
|
||||
if (wait_lock) {
|
||||
WSREP_DEBUG("canceling wait lock");
|
||||
victim_trx->was_chosen_as_deadlock_victim= TRUE;
|
||||
mutex_enter(&kernel_mutex);
|
||||
lock_cancel_waiting_and_release(wait_lock);
|
||||
mutex_exit(&kernel_mutex);
|
||||
}
|
||||
|
||||
wsrep_thd_awake(bf_thd, thd, signal);
|
||||
@@ -14076,10 +14078,8 @@ wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd,
|
||||
|
||||
if (victim_trx)
|
||||
{
|
||||
mutex_enter(&kernel_mutex);
|
||||
int rcode = wsrep_innobase_kill_one_trx(bf_trx, victim_trx,
|
||||
signal);
|
||||
mutex_exit(&kernel_mutex);
|
||||
wsrep_srv_conc_cancel_wait(victim_trx);
|
||||
DBUG_RETURN(rcode);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user