Skip to content

Commit

Permalink
Bug 520 - vnode throws error during handoff
Browse files Browse the repository at this point in the history
Remove code that performs a double-wrapping of requests.
  • Loading branch information
slfritchie committed Feb 10, 2011
1 parent ece9c3a commit 3bdc33b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/riak_core_vnode.erl
Expand Up @@ -106,19 +106,18 @@ vnode_command(Sender, Request, State=#state{mod=Mod, modstate=ModState}) ->
{stop, Reason, State#state{modstate=NewModState}}
end.

vnode_handoff_command(Sender, Request, WrapperReq,
State=#state{index=Index,
mod=Mod,
modstate=ModState,
handoff_node=HN}) ->
vnode_handoff_command(Sender, Request, State=#state{index=Index,
mod=Mod,
modstate=ModState,
handoff_node=HN}) ->
case Mod:handle_handoff_command(Request, Sender, ModState) of
{reply, Reply, NewModState} ->
reply(Sender, Reply),
continue(State, NewModState);
{noreply, NewModState} ->
continue(State, NewModState);
{forward, NewModState} ->
riak_core_vnode_master:command({Index, HN}, WrapperReq, Sender,
riak_core_vnode_master:command({Index, HN}, Request, Sender,
riak_core_vnode_master:reg_name(Mod)),
continue(State, NewModState);
{drop, NewModState} ->
Expand All @@ -142,8 +141,8 @@ active(timeout, State=#state{mod=Mod, modstate=ModState}) ->
active(?VNODE_REQ{sender=Sender, request=Request},
State=#state{handoff_node=HN}) when HN =:= none ->
vnode_command(Sender, Request, State);
active(VR=?VNODE_REQ{sender=Sender, request=Request},State) ->
vnode_handoff_command(Sender, Request, VR, State);
active(?VNODE_REQ{sender=Sender, request=Request},State) ->
vnode_handoff_command(Sender, Request, State);
active(handoff_complete, State=#state{mod=Mod,
modstate=ModState,
index=Idx,
Expand Down

0 comments on commit 3bdc33b

Please sign in to comment.