summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2023-03-27 13:12:20 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2023-03-27 13:12:20 +0300
commit7880f6a5197450d415f1bc50f5a208f68d4a6b0c (patch)
treef473b39d860c903716ad43a30f905ec238fcfa7a
parent304374d2df990c105ca3af3f246c3c6c1ac5e11d (diff)
downloadmariadb-git-7880f6a5197450d415f1bc50f5a208f68d4a6b0c.tar.gz
trx_assign_rseg_low(): Simplify debug instrumentation
-rw-r--r--storage/innobase/trx/trx0trx.cc21
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;