Commits

jus...@basho.com  committed 6b8308b

check Mod:put return during handoff

  • Participants
  • Parent commits 3ff8d3a

Comments (0)

Files changed (1)

File apps/riak/src/riak_vnode.erl

 active(timeout, StateData) ->
     hometest(StateData);
 active({diffobj,{BKey,BinObj,FromVN}}, StateData) ->
-    do_diffobj_put(BKey, binary_to_term(BinObj), StateData),
-    gen_fsm:send_event(FromVN,{resolved_diffobj,BKey}),
+    case do_diffobj_put(BKey, binary_to_term(BinObj), StateData) of
+        ok ->
+            gen_fsm:send_event(FromVN,{resolved_diffobj,BKey});
+        {error, Err} ->
+            error_logger:error_msg("Error storing handoff obj: ~p~n", [Err])
+    end,
     {next_state,active,StateData,?TIMEOUT};
 active({map, ClientPid, QTerm, BKey, KeyData},
        StateData=#state{mapcache=Cache,mod=Mod,modstate=ModState}) ->
         {newobj, NewObj} ->
             AMObj = enforce_allow_mult(NewObj, riak_bucket:get_bucket(Bucket)),
             Val = term_to_binary(AMObj),
-            Mod:put(ModState, BKey, Val),
-            riak_stat:update(vnode_put);
-        _ -> nop
+            Res = Mod:put(ModState, BKey, Val),
+            case Res of
+                ok -> riak_stat:update(vnode_put);
+                _ -> nop
+            end,
+            Res;
+        _ -> ok
     end.
 
 %% @private