From 548d9d4b0384c295b1f6b0de2406766e937af55a Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 15 May 2015 01:19:09 +0300 Subject: [PATCH] lmdb: bugfix, OOM-handler couldn't help if LIFO-reclaiming disabled. This is fixes https://github.com/ReOpen/ReOpenLDAP/issues/28 Change-Id: Ifc33e1202ae38f0a4fa0cb9d572394a4dac7ec6c --- mdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mdb.c b/mdb.c index fc326b65..29e453c0 100644 --- a/mdb.c +++ b/mdb.c @@ -2218,7 +2218,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) txnid_t oldest = 0, last = 0; MDB_cursor_op op; MDB_cursor m2; - int found_old = 0; + int found_old; unsigned enought = env->me_maxfree_1pg / 2; /* mp == NULL when mdb_freelist_save() force reclaim to @@ -2249,6 +2249,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp) const int lifo = (env->me_flags & MDB_LIFORECLAIM) != 0; oomkick_retry:; + found_old = 0; for (op = MDB_FIRST;; op = lifo ? MDB_PREV : MDB_NEXT) { MDB_val key, data; MDB_node *leaf;