Commit b36da48a authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-15612 - Latching violation in trx_roll_must_shutdown

recv_sys_t::mutex and rw_trx_hash_elementi_t::mutex were acquired
in reverse (to recorded) order.

Fixed by releasing recv_sys_t::mutex, before iterating rw_trx_hash.
Statistics gathering doesn't really need recv_sys_t::mutex protection,
since it is always done in one thread (trx_roll_crash_recv_trx) and
thus it can't go wrong.
parent 2a13b3db
......@@ -737,8 +737,10 @@ trx_roll_must_shutdown()
ib_time_t time = ut_time();
mutex_enter(&recv_sys->mutex);
bool report = recv_sys->report(time);
mutex_exit(&recv_sys->mutex);
if (recv_sys->report(time)) {
if (report) {
trx_roll_count_callback_arg arg;
/* Get number of recovered active transactions and number of
......@@ -752,8 +754,6 @@ trx_roll_must_shutdown()
sd_notifyf(0, "STATUS=To roll back: " UINT32PF " transactions,"
" " UINT64PF " rows", arg.n_trx, arg.n_rows);
}
mutex_exit(&recv_sys->mutex);
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment