From cd1b9ea1cf5bc66559785c391eb6ad899dbef35d Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 21 Sep 2018 02:36:04 +0300 Subject: [PATCH] mdbx: fix and simplify lifo-cleanup-loop inside update_gc(). --- src/mdbx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index df884053..623e8386 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -3839,9 +3839,6 @@ retry: cleaned_gc_id = txn->mt_lifo_reclaimed[++cleaned_gc_slot]; mdbx_tassert(txn, cleaned_gc_slot > 0 && cleaned_gc_id < *env->me_oldest); - head_gc_id = (!head_gc_id || head_gc_id > cleaned_gc_id) - ? cleaned_gc_id - : head_gc_id; key.iov_base = &cleaned_gc_id; key.iov_len = sizeof(cleaned_gc_id); rc = mdbx_cursor_get(&mc, &key, NULL, MDBX_SET); @@ -3862,7 +3859,7 @@ retry: goto bailout; } while (cleaned_gc_slot < MDBX_PNL_SIZE(txn->mt_lifo_reclaimed)); mdbx_txl_sort(txn->mt_lifo_reclaimed); - mdbx_tassert(txn, MDBX_PNL_LAST(txn->mt_lifo_reclaimed) == head_gc_id); + head_gc_id = MDBX_PNL_LAST(txn->mt_lifo_reclaimed); } } else { /* If using records from freeDB which we have not yet deleted,