Skip to content

Commit

Permalink
Correct time range checking in GC invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kuenishi committed May 25, 2015
1 parent 8fe19ac commit e2995ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/riak_cs_gc_batch.erl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ init([#gc_batch_state{
end_key=EndKey,
leeway=Leeway,
max_workers=MaxWorkers} = State])
when StartKey >= 0 andalso StartKey =< EndKey ->

when
%% StartKey must be non-negative as <<"-">> is larger than any numeric digits
0 =< StartKey andalso
%% EndKey cannot be like 300, or would collect all gc keys
1000000000 =< EndKey andalso
StartKey =< EndKey ->
case riak_cs_gc:default_batch_end(BatchStart, Leeway) of
DefaultEndKey when EndKey =< DefaultEndKey ->
%% StartKey < EndKey
Expand Down
6 changes: 4 additions & 2 deletions src/riak_cs_gc_console.erl
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ parse_batch_opts(Args) ->

batch_options() ->
[{leeway, $l, "leeway", integer, "Leeway seconds"},
{start, $s, "start", string, "Start time (iso8601 format, like 19701020T094500Z)"},
{'end', $e, "end", string, "End time (iso8601 format, like 19701021T094500Z)"},
{start, $s, "start", string,
"Start time (iso8601 format, like 20130320T094500Z)"},
{'end', $e, "end", string,
"End time (iso8601 format, like 20130420T094500Z)"},
{'max-workers', $c, "max-workers", integer, "Number of concurrent workers"}].

convert(Options) ->
Expand Down

0 comments on commit e2995ee

Please sign in to comment.