Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/fd/riak 1937 #1159

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dialyzer.ignore-warnings
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Callback info about the riak_kv_backend behaviour is not available
Unknown functions:
dtrace:init/0
yz_kv:index/3
yz_kv:index_binary/5
yz_kv:should_handoff/1
yz_stat:search_stats/0
Unknown types:
Expand Down
4 changes: 4 additions & 0 deletions src/riak_kv_vnode.erl
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@
-ifdef(TEST).
%% Use values so that test compile doesn't give 'unused vars' warning.
-define(INDEX(A,B,C), _=element(1,{A,B,C}), ok).
-define(INDEX_BIN(A,B,C,D,E), _=element(1,{A,B,C,D,E}), ok).
-else.
-define(INDEX(Obj, Reason, Partition), yz_kv:index(Obj, Reason, Partition)).
-define(INDEX_BIN(Bucket, Key, Obj, Reason, Partition), yz_kv:index_binary(Bucket, Key, Obj, Reason, Partition)).
-endif.

-ifdef(TEST).
Expand Down Expand Up @@ -841,6 +843,7 @@ handle_command(?KV_W1C_PUT_REQ{bkey={Bucket, Key}, encoded_obj=EncodedVal, type=
case Mod:put(Bucket, Key, [], EncodedVal, ModState) of
{ok, UpModState} ->
update_hashtree(Bucket, Key, EncodedVal, State),
?INDEX_BIN(Bucket, Key, EncodedVal, put, Idx),
update_vnode_stats(vnode_put, Idx, StartTS),
{reply, ?KV_W1C_PUT_REPLY{reply=ok, type=Type}, State#state{modstate=UpModState}};
{error, Reason, UpModState} ->
Expand Down Expand Up @@ -1164,6 +1167,7 @@ terminate(_Reason, #state{mod=Mod, modstate=ModState}) ->
handle_info({{w1c_async_put, From, Type, Bucket, Key, EncodedVal, StartTS} = _Context, Reply},
State=#state{idx=Idx}) ->
update_hashtree(Bucket, Key, EncodedVal, State),
?INDEX_BIN(Bucket, Key, EncodedVal, put, Idx),
riak_core_vnode:reply(From, ?KV_W1C_PUT_REPLY{reply=Reply, type=Type}),
update_vnode_stats(vnode_put, Idx, StartTS),
{ok, State};
Expand Down