Permalink
Browse files

Now delete any expired file, regardless of other reasons for merge

  • Loading branch information...
bsparrow435 committed May 10, 2013
1 parent 167882e commit 16da3d05a9386e26eaba72da0a9ff266f70a5314
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/bitcask.erl
View
@@ -691,7 +691,15 @@ needs_merge(Ref) ->
ok
end,
FileNames = [Filename || {Filename, _Reasons} <- MergableFiles],
- ExpiredFiles = [Filename || {Filename, [{data_expired,_,_}]} <- MergableFiles],
+ F = fun(X) ->
+ case X of
+ {data_expired,_,_} ->
+ true;
+ _ ->
+ false
+ end
+ end,
+ ExpiredFiles = [Filename || {Filename, Reasons} <- MergableFiles, lists:any(F,Reasons)],
{true, {FileNames, ExpiredFiles}};
false ->
false

0 comments on commit 16da3d0

Please sign in to comment.