Skip to content

Commit

Permalink
Add max_scheduled_delete_manifests config into cuttlefish schema, and
Browse files Browse the repository at this point in the history
change default value to 50
  • Loading branch information
ksauzz committed Jul 21, 2015
1 parent 09ec885 commit a622486
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/riak_cs_gc.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
-define(DEFAULT_GC_BATCH_SIZE, 1000).
-define(DEFAULT_GC_WORKERS, 2).
-define(EPOCH_START, <<"0">>).
-define(DEFAULT_MAX_SCHEDULED_DELETE_MANIFESTS, 50).

-record(gc_manager_state, {
next :: undefined | non_neg_integer(),
Expand Down
8 changes: 8 additions & 0 deletions rel/files/riak_cs.schema
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@
{datatype, flag}
]}.

%% @doc Max number of manifests that can be in the
%% `scheduled_delete' state for a given key. `unlimited' means there
%% is no maximum, and pruning will not happen based on count.
{mapping, "max_scheduled_delete_manifests", "riak_cs.max_scheduled_delete_manifests", [
{default, 50},
{datatype, [integer, {atom, unlimited}]}
]}.

%% == Garbage Collection ==

%% @doc The time to retain the block for an object after it has been
Expand Down
2 changes: 1 addition & 1 deletion src/riak_cs_gc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ set_leeway_seconds(_LeewaySeconds) ->
max_scheduled_delete_manifests() ->
case application:get_env(riak_cs, max_scheduled_delete_manifests) of
undefined ->
unlimited;
?DEFAULT_MAX_SCHEDULED_DELETE_MANIFESTS;
{ok, MaxCount} ->
MaxCount
end.
Expand Down
7 changes: 7 additions & 0 deletions test/riak_cs_config_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ default_config_test() ->
cuttlefish_unit:assert_config(Config, "riak_cs.max_buckets_per_user", 100),
cuttlefish_unit:assert_config(Config, "riak_cs.trust_x_forwarded_for", false),
cuttlefish_unit:assert_config(Config, "riak_cs.leeway_seconds", 86400),
cuttlefish_unit:assert_config(Config, "riak_cs.max_scheduled_delete_manifests", 50),
cuttlefish_unit:assert_config(Config, "riak_cs.gc_interval", 900),
cuttlefish_unit:assert_config(Config, "riak_cs.gc_retry_interval", 21600),
cuttlefish_unit:assert_config(Config, "riak_cs.gc_paginated_indexes", true),
Expand Down Expand Up @@ -98,6 +99,12 @@ gc_interval_infinity_test() ->
cuttlefish_unit:assert_config(Config, "riak_cs.gc_interval", infinity),
ok.

max_scheduled_delete_manifests_unlimited_test() ->
Conf = [{["max_scheduled_delete_manifests"], unlimited}],
Config = cuttlefish_unit:generate_templated_config(schema_files(), Conf, context()),
cuttlefish_unit:assert_config(Config, "riak_cs.max_scheduled_delete_manifests", unlimited),
ok.

active_delete_threshold_test() ->
Conf = [{["active_delete_threshold"], "10mb"}],
Config = cuttlefish_unit:generate_templated_config(schema_files(), Conf, context()),
Expand Down

6 comments on commit a622486

@shino
Copy link
Contributor

@shino shino commented on a622486 Jul 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from shino
at a622486

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging basho/riak_cs/feature/max-scheduled-delete-manifests-in-cuttlefish = a622486 into borshop-integration-1196-feature/max-scheduled-delete-manifests-in-cuttlefish

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basho/riak_cs/feature/max-scheduled-delete-manifests-in-cuttlefish = a622486 merged ok, testing candidate = 5cbec6f

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@borshop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding develop to borshop-integration-1196-feature/max-scheduled-delete-manifests-in-cuttlefish = 5cbec6f

Please sign in to comment.