Skip to content

Ability to delete custom bucket properties #197

trynity opened this Issue Jun 23, 2012 · 2 comments

4 participants

trynity commented Jun 23, 2012

Right now, while we have the ability in riak_core_bucket to set bucket properties:

%% @spec set_bucket(riak_object:bucket(), BucketProps::riak_core_bucketprops()) -> ok
%% @doc Set the given BucketProps in Bucket.
set_bucket(Name, BucketProps0) ->
    case validate_props(BucketProps0, riak_core:bucket_validators(), []) of
        {ok, BucketProps} ->
            F = fun(Ring, _Args) ->
                        OldBucket = get_bucket(Name),
                        NewBucket = merge_props(BucketProps, OldBucket),
                        {new_ring, riak_core_ring:update_meta({bucket,Name},
            {ok, _NewRing} = riak_core_ring_manager:ring_trans(F, undefined),
        {error, Details} ->
            lager:error("Bucket validation failed ~p~n", [Details]),
            {error, Details}

We do not have the ability to delete custom bucket properties. Since these are stored in the ring, this adds up when creating hundreds/thousands of buckets with custom properties. A use case that has been seen is where certain buckets require the search post-commit hook, and others do not.

Right now, even if you delete all the keys and attempt to set the bucket properties back to default, it still will be kept in the ring.

It should be feasible to delete the dict key for a certain bucket's properties, and have it revert back to default properties.

jerith commented Jun 23, 2012

The slowdown in setting bucket properties when there is already a lot of metadata is quite extreme. See for a script that demonstrates this.

@jrwest jrwest was assigned Oct 31, 2012
@slfritchie slfritchie was assigned Nov 13, 2012
Basho Technologies member

All constituent tickets reviewed, +1 to merge, thanks!

@jrwest jrwest was assigned Nov 13, 2012
@jrwest jrwest referenced this issue in basho/riak_test Nov 13, 2012

reset bucket properties test #81

@jrwest jrwest closed this Dec 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.