From bd51e181fb3002ef926637c9f864bb79e0a7ee02 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 30 Jan 2022 11:46:43 +0300 Subject: [PATCH] mdbx: refine comment for `mdbx_update_gc()`. --- src/core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core.c b/src/core.c index e7bd1e63..0911eca5 100644 --- a/src/core.c +++ b/src/core.c @@ -8771,9 +8771,15 @@ static __inline void clean_reserved_gc_pnl(MDBX_env *env, MDBX_val pnl) { memset(pnl.iov_base, 0, pnl.iov_len); } -/* Cleanup reclaimed GC records, than save the retired-list as of this - * transaction to GC (aka freeDB). This recursive changes the reclaimed-list - * loose-list and retired-list. Keep trying until it stabilizes. */ +/* Cleanups reclaimed GC (aka freeDB) records, saves the retired-list (aka + * freelist) of current transaction to GC, puts back into GC leftover of the + * reclaimed pages with chunking. This recursive changes the reclaimed-list, + * loose-list and retired-list. Keep trying until it stabilizes. + * + * NOTE: This code is a consequence of many iterations of adding crutches (aka + * "checks and balances") to partially bypass the fundamental design problems + * inherited from LMDB. So do not try to understand it completely in order to + * avoid your madness. */ static int mdbx_update_gc(MDBX_txn *txn) { /* txn->tw.reclaimed_pglist[] can grow and shrink during this call. * txn->tw.last_reclaimed and txn->tw.retired_pages[] can only grow.