diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index d7ab02844bf..21a5347b0ec 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -811,30 +811,23 @@ static void trx_assign_rseg_low(trx_t *trx) static Atomic_counter<unsigned> rseg_slot; unsigned slot = rseg_slot++ % TRX_SYS_N_RSEGS; ut_d(if (trx_rseg_n_slots_debug) slot = 0); + ut_d(const auto start_scan_slot = slot); trx_rseg_t* rseg; -#ifdef UNIV_DEBUG - ulint start_scan_slot = slot; - bool look_for_rollover = false; -#endif /* UNIV_DEBUG */ - bool allocated; do { for (;;) { rseg = &trx_sys.rseg_array[slot]; -#ifdef UNIV_DEBUG - /* Ensure that we are not revisiting the same - slot that we have already inspected. */ - if (look_for_rollover) { + ut_d(if (!trx_rseg_n_slots_debug)) + { + slot = (slot + 1) % TRX_SYS_N_RSEGS; + + /* Ensure that we are not revisiting the same + slot that we have already inspected. */ ut_ad(start_scan_slot != slot); } - look_for_rollover = true; -#endif /* UNIV_DEBUG */ - - ut_d(if (!trx_rseg_n_slots_debug)) - slot = (slot + 1) % TRX_SYS_N_RSEGS; if (!rseg->space) { continue; |