Browse Source

MDEV-36509 : Galera test failure on galera_sr.mysql-wsrep-features#165

Problem was that thread was holding lock_sys.wait_mutex when
streaming replication transaction rollback was handled and
in wsrep-lib requests THD::LOCK_thd_kill mutex causing
wrong mutex usage (thd->reset_globals()).

Fix is to remove streaming replication rollback handling
from Deadlock::report() i.e. wsrep_handle_SR_rollback call.
Purpose of Deadloc::report() is to find a cycle in the
waits-for graph if exists, report it, mark victim transaction
as deadlock victim and release locks it is waiting for.
Actual streaming replication rollback that can take longer
time can be handled later at trx_t::rollback where
lock_sys.wait_mutex is not held.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
pull/3983/head
Jan Lindström 6 months ago
committed by Julius Goryavsky
parent
commit
5f2562291c
  1. 4
      storage/innobase/lock/lock0lock.cc

4
storage/innobase/lock/lock0lock.cc

@ -7108,10 +7108,6 @@ and less modified rows. Bit 0 is used to prefer orig_trx in case of a tie.
victim->lock.was_chosen_as_deadlock_victim= true;
DEBUG_SYNC_C("deadlock_report_before_lock_releasing");
lock_cancel_waiting_and_release<true>(victim->lock.wait_lock);
#ifdef WITH_WSREP
if (victim->is_wsrep() && wsrep_thd_is_SR(victim->mysql_thd))
wsrep_handle_SR_rollback(trx->mysql_thd, victim->mysql_thd);
#endif
}
func_exit:

Loading…
Cancel
Save