Skip to content

Commit

Permalink
Vclock decoded prior to compare
Browse files Browse the repository at this point in the history
So vlock should not be decoded in repair
  • Loading branch information
martinsumner committed Dec 7, 2020
1 parent 33add2a commit 1eb129c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/riak_kv_ttaaefs_manager.erl
Original file line number Diff line number Diff line change
Expand Up @@ -709,19 +709,18 @@ generate_repairfun(ExchangeID, QueueName) ->
fun({{B, K}, {SrcVC, SinkVC}}, {SourceL, SinkC}) ->
% how are the vector clocks encoded at this point?
% The erlify_aae_keyclock will have base64 decoded the clock
SinkVCdecoded = decode_clock(SinkVC),
case vclock_dominates(SinkVCdecoded, SrcVC) of
case vclock_dominates(SinkVC, SrcVC) of
true ->
{SourceL, SinkC + 1};
false ->
% If the vector clock in the source is not dominated
% by the sink, then we should replicate if it differs
case {vclock_equal(SrcVC, SinkVCdecoded),
case {vclock_equal(SrcVC, SinkVC),
LogRepairs} of
{false, true} ->
lager:info(
"Repair B=~p K=~p SrcVC=~w SnkVC=~w",
[B, K, SrcVC, SinkVCdecoded]),
[B, K, SrcVC, SinkVC]),
{[{B, K, SrcVC, to_fetch}|SourceL], SinkC};
{false, false} ->
{[{B, K, SrcVC, to_fetch}|SourceL], SinkC};
Expand Down

0 comments on commit 1eb129c

Please sign in to comment.