Skip to content

Commit b36da48

Browse files
committed
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.
1 parent 2a13b3d commit b36da48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

storage/innobase/trx/trx0roll.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,10 @@ trx_roll_must_shutdown()
737737

738738
ib_time_t time = ut_time();
739739
mutex_enter(&recv_sys->mutex);
740+
bool report = recv_sys->report(time);
741+
mutex_exit(&recv_sys->mutex);
740742

741-
if (recv_sys->report(time)) {
743+
if (report) {
742744
trx_roll_count_callback_arg arg;
743745

744746
/* Get number of recovered active transactions and number of
@@ -752,8 +754,6 @@ trx_roll_must_shutdown()
752754
sd_notifyf(0, "STATUS=To roll back: " UINT32PF " transactions,"
753755
" " UINT64PF " rows", arg.n_trx, arg.n_rows);
754756
}
755-
756-
mutex_exit(&recv_sys->mutex);
757757
return false;
758758
}
759759

0 commit comments

Comments
 (0)