Skip to content

Commit 735a494

Browse files
author
Sean Cribbs
committed
Merge pull request #31 from basho/sdc-repl-prop-bug
Fix errors with repl bucket property.
2 parents 0709ded + 0906b0f commit 735a494

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/riak.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ message RpbBucketProps {
115115

116116
// Used by riak_repl bucket fixup
117117
enum RpbReplMode {
118-
off = 0;
118+
false = 0;
119119
realtime = 1;
120120
fullsync = 2;
121-
both = 3;
121+
true = 3;
122122
}
123123
optional RpbReplMode repl = 22;
124124
}

src/riak_pb_codec.erl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ encode_bucket_props([{backend, B}|Rest], Pb) ->
329329
encode_bucket_props([{search, S}|Rest], Pb) ->
330330
encode_bucket_props(Rest, Pb#rpbbucketprops{search = encode_bool(S)});
331331
encode_bucket_props([{repl, Atom}|Rest], Pb) ->
332-
encode_bucket_props(Rest, Pb#rpbbucketprops{repl = Atom});
332+
encode_bucket_props(Rest, Pb#rpbbucketprops{repl = encode_repl(Atom)});
333333
encode_bucket_props([_Ignore|Rest], Pb) ->
334334
%% Ignore any properties not explicitly part of the PB message
335335
encode_bucket_props(Rest, Pb).
@@ -391,3 +391,6 @@ decode_commit_hook(#rpbcommithook{modfun = Modfun}) when Modfun =/= undefined ->
391391
decode_modfun(Modfun, commit_hook);
392392
decode_commit_hook(#rpbcommithook{name = Name}) when Name =/= undefined ->
393393
{struct, [{<<"name">>, Name}]}.
394+
395+
encode_repl(both) -> true;
396+
encode_repl(A) -> A.

test/bucket_props_codec_eqc.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ backend() ->
108108
?LET(B, non_empty(binary()), {backend, B}).
109109

110110
repl() ->
111-
?LET(R, oneof([off, realtime, fullsync, both]), {repl, R}).
111+
?LET(R, oneof([false, realtime, fullsync, true]), {repl, R}).
112112

113113
commit(Prop) ->
114114
?LET(C, non_empty(list(commit_hook())), {Prop, C}).

0 commit comments

Comments
 (0)