Skip to content

Commit

Permalink
Merge b53951c into b502dee
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallEndian committed Aug 5, 2019
2 parents b502dee + b53951c commit 194a0d2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{erlzmq, {git, "https://github.com/zeromq/erlzmq2", {ref, "573d583"}}},

%% antidote utilities
antidote_crdt,
antidote_pb_codec,
{antidote_crdt, {git, "https://github.com/SmallEndian/antidote_crdt", {branch, master}}},
{antidote_pb_codec, {git, "https://github.com/SmallEndian/antidote_pb_codec", {branch, master}}},
antidotec_pb,
vectorclock,

Expand Down
4 changes: 4 additions & 0 deletions src/bcounter_mgr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ generate_downstream(Key, {decrement, {V, _}}, BCounter) ->
generate_downstream(_Key, {increment, {Amount, _}}, BCounter) ->
MyDCId = dc_meta_data_utilities:get_my_dc_id(),
?DATA_TYPE:downstream({increment, {Amount, MyDCId}}, BCounter);
generate_downstream(Key, {increment, Amount}, BCounter) when Amount < 0->
generate_downstream(Key, {decrement, {-Amount, empty}}, BCounter);
generate_downstream(Key, {increment, Amount}, BCounter)->
generate_downstream(Key, {increment, {Amount, empty}}, BCounter);

%% @doc Processes a trasfer operation between two owners of the
%% counter.
Expand Down
2 changes: 1 addition & 1 deletion src/clocksi_interactive_coord.erl
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ execute_command(update_objects, UpdateOps, Sender, State = #state{transaction=Tr
updated_partitions=UpdatedPartitions
}
end
end,
end,

NewCoordState = lists:foldl(
ExecuteUpdates,
Expand Down
6 changes: 3 additions & 3 deletions test/singledc/bcountermgr_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ new_bcounter_test(Config) ->
Key = bcounter1_mgr,

% FIXME why is this not working?
%{Value, _} = antidote_utils:read_b_counter(Node, Key, Bucket),
%?assertEqual(0, Value).
check_read(Node, Key, 0, Bucket).
{Value, _} = antidote_utils:read_b_counter(Node, Key, Bucket),
?assertEqual(0, Value).
%check_read(Node, Key, 0, Bucket).

read_si(Node, Key, CommitTime, Bucket) ->
ct:log("Read si ~p", [Key]),
Expand Down
3 changes: 2 additions & 1 deletion test/utils/antidote_utils.erl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ read_b_counter(Node, Key, Bucket) ->
read_b_counter_commit(Node, Key, Bucket, CommitTime) ->
Obj = {Key, ?TYPE_B, Bucket},
{ok, [Value], CommitTime} = rpc:call(Node, antidote, read_objects, [CommitTime, [], [Obj]]),
{?TYPE_B:permissions(Value), CommitTime}.
{?TYPE_B:value(Value), CommitTime}.
%{?TYPE_B:permissions(Value), CommitTime}.



Expand Down

0 comments on commit 194a0d2

Please sign in to comment.