From ef64425af3f8f6ee480f366281ae500716a3117b Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Tue, 31 Jul 2012 21:10:51 +0200 Subject: [PATCH] Only keep merged < level-size at last level The previous fix introduced the issue, that we might observe a level that never gets merged, and thus some values may never be evicted. --- src/hanoidb_level.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hanoidb_level.erl b/src/hanoidb_level.erl index 7359e4c..a7459c0 100644 --- a/src/hanoidb_level.erl +++ b/src/hanoidb_level.erl @@ -547,7 +547,9 @@ main_loop(State = #state{ next=Next }) -> end; ?CAST(_From,{merge_done, Count, OutFileName}) - when Count =< ?BTREE_SIZE(State#state.level), State#state.c =:= undefined -> + when Count =< ?BTREE_SIZE(State#state.level), + State#state.c =:= undefined, + Next =:= undefined -> ?log("merge_done, out:~w~n -> self", [Count]),