Skip to content

Commit 19c6381

Browse files
authored
Merge pull request #696 from basho/bugfix/csm/write-once
Add capability for default hash.
2 parents 06a0ca9 + 1225df3 commit 19c6381

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/riak_repl_app.erl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ start(_Type, _StartArgs) ->
4747
riak_core_capability:register({riak_repl, rtq_meta},
4848
[true, false], false),
4949

50+
%% Register capability for the default bucket properties hash.
51+
riak_core_capability:register(
52+
{riak_repl, default_bucket_props_hash},
53+
[
54+
%% 2.0.6, 2.1.2
55+
[consistent, datatype, n_val, write_once],
56+
57+
%% 2.0.5, 2.1.1 and earlier
58+
[consistent, datatype, n_val, allow_mult, last_write_wins]
59+
],
60+
[consistent, datatype, n_val, allow_mult, last_write_wins]),
61+
5062
%% skip Riak CS blocks
5163
case riak_repl_util:proxy_get_active() of
5264
true ->

src/riak_repl_bucket_type_util.erl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
-define(DEFAULT_BUCKET_TYPE, <<"default">>).
1616

17-
-define(DEFAULT_HASH_BUCKET_PROPS, [consistent, datatype, n_val, allow_mult, last_write_wins]).
18-
1917
-spec bucket_props_match(proplists:proplist()) -> boolean().
2018
bucket_props_match(Props) ->
2119
case is_bucket_typed(Props) of
@@ -53,4 +51,7 @@ prop_get(Key, Default, Props) ->
5351
property_hash(undefined) ->
5452
undefined;
5553
property_hash(Type) ->
56-
riak_core_bucket_type:property_hash(Type, ?DEFAULT_HASH_BUCKET_PROPS).
54+
Defaults = riak_core_capability:get(
55+
{riak_repl, default_bucket_props_hash},
56+
[consistent, datatype, n_val, allow_mult, last_write_wins]),
57+
riak_core_bucket_type:property_hash(Type, Defaults).

0 commit comments

Comments
 (0)