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.
This commit is contained in:
Kresten Krab Thorup 2012-07-31 21:10:51 +02:00
parent 166a127a43
commit ef64425af3

View file

@ -547,7 +547,9 @@ main_loop(State = #state{ next=Next }) ->
end; end;
?CAST(_From,{merge_done, Count, OutFileName}) ?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]), ?log("merge_done, out:~w~n -> self", [Count]),