Permalink
Browse files

Tighten bitcask data file regex (currently picks up NNNN.bitcask.data*)

Make sure the regex is tight so that if people move bitcask files
out of the way during recovery e.g. 123.bitcask.data.bak then they
are not included when deciding on the next filename.
  • Loading branch information...
1 parent bef7143 commit c8dbd61bdfe5e8cd8bdfb15a4255c4e8e905f524 @jonmeredith jonmeredith committed Feb 9, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/bitcask_fileops.erl
View
@@ -114,7 +114,7 @@ close_for_writing(State =
%% match our regex.
-spec data_file_tstamps(Dirname :: string()) -> [{integer(), string()}].
data_file_tstamps(Dirname) ->
- filelib:fold_files(Dirname, "[0-9]+.bitcask.data", false,
+ filelib:fold_files(Dirname, "[0-9]+.bitcask.data$", false,
fun(F, Acc) ->
[{file_tstamp(F), F} | Acc]
end, []).

0 comments on commit c8dbd61

Please sign in to comment.