Skip to content

Commit

Permalink
MDEV-15612 - Latching violation in trx_roll_must_shutdown
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Sergey Vojtovich committed Mar 29, 2018
1 parent 2a13b3d commit b36da48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/innobase/trx/trx0roll.cc
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down

0 comments on commit b36da48

Please sign in to comment.