lmdb: bugfix, OOM-handler couldn't help if LIFO-reclaiming disabled.

This is fixes https://github.com/ReOpen/ReOpenLDAP/issues/28

Change-Id: Ifc33e1202ae38f0a4fa0cb9d572394a4dac7ec6c
This commit is contained in:
Leo Yuriev 2015-05-15 01:19:09 +03:00
parent 7919a0f124
commit 548d9d4b03

3
mdb.c
View File

@ -2218,7 +2218,7 @@ mdb_page_alloc(MDB_cursor *mc, int num, MDB_page **mp)
txnid_t oldest = 0, last = 0; txnid_t oldest = 0, last = 0;
MDB_cursor_op op; MDB_cursor_op op;
MDB_cursor m2; MDB_cursor m2;
int found_old = 0; int found_old;
unsigned enought = env->me_maxfree_1pg / 2; unsigned enought = env->me_maxfree_1pg / 2;
/* mp == NULL when mdb_freelist_save() force reclaim to /* 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; const int lifo = (env->me_flags & MDB_LIFORECLAIM) != 0;
oomkick_retry:; oomkick_retry:;
found_old = 0;
for (op = MDB_FIRST;; op = lifo ? MDB_PREV : MDB_NEXT) { for (op = MDB_FIRST;; op = lifo ? MDB_PREV : MDB_NEXT) {
MDB_val key, data; MDB_val key, data;
MDB_node *leaf; MDB_node *leaf;