Commits

Anonymous committed 065e150

get rid of some debugging io:formats

  • Participants
  • Parent commits 29b93aa

Comments (0)

Files changed (2)

apps/riak/src/riak_handoff_sender.erl

                      {fold, {Partition, fun folder/3, {Socket, ParentPid, []}}},
                      infinity);
         _ ->
-            io:format("intermediate handoff:~n~p~n",[BKeyList]),
             inner_fold({Socket,ParentPid,[]},BKeyList)
     end,
     gen_fsm:send_event(ParentPid, handoff_complete).
 inner_fold(_FoldArg,[]) -> ok;
 inner_fold(FoldArg,[{B,K}|Tail]) ->
     {_Socket,ParentPid,_Count} = FoldArg,
-    {ok, V} = gen_fsm:sync_send_event(ParentPid, {get_binary, {B,K}}, infinity),
-    inner_fold(folder({B,K},V,FoldArg),Tail).
-
+    case gen_fsm:sync_send_event(ParentPid, {get_binary, {B,K}}, infinity) of
+        {ok, V} ->
+            inner_fold(folder({B,K},V,FoldArg),Tail);
+        _ ->
+            inner_fold(FoldArg,Tail)
+    end.
+            
 folder({B,K}, V, {Socket, ParentPid, []}) ->
     gen_tcp:controlling_process(Socket, self()),
     visit_item({B,K}, V, {Socket, ParentPid, 0});

apps/riak/src/riak_vnode.erl

 start_link(Idx) -> gen_fsm:start_link(?MODULE, [Idx], []).
 
 init([VNodeIndex]) ->
-    io:format("~p init~n",[VNodeIndex]),
     Mod = riak:get_app_env(storage_backend),
     Configuration = riak:get_app_env(),
     {ok, ModState} = Mod:start(VNodeIndex, Configuration),
         {next_state, StateName, StateData, Timeout} ->
             {ok, StateName, StateData, Timeout};
         {stop,normal,StateData} ->
-%            {stop, normal}
-            % always stick around for one timeout cycle
-            % restart the backend as it may have deleted its data
             {ok, ModState1} = Mod:start(VNodeIndex, Configuration),
             {ok, active, StateData#state{mod=Mod, modstate=ModState1}, ?TIMEOUT}
     end.
     Me = node(),
     case riak_ring:index_owner(MyRing, Idx) of
         Me ->
-            io:format("~p hometest home~n",[Idx]),
             {next_state,active,StateData#state{handoff_q=not_in_handoff},
              ?TIMEOUT};
         TargetNode ->
             case net_adm:ping(TargetNode) of
                 pang -> 
-                    io:format("~p hometest pang~n",[Idx]),
                     {next_state,active,StateData,?TIMEOUT};
                 pong -> 
                     case HQ of
                         not_in_handoff ->
-                            io:format("~p hometest dh~n",[Idx]),
                             do_handoff(TargetNode, StateData);
                         _ ->
-                            io:format("~p hometest dLh~n",[Idx]),
                             do_list_handoff(TargetNode, HQ, StateData)
                     end
             end
 do_handoff(TargetNode, StateData=#state{idx=Idx, mod=Mod, modstate=ModState}) ->
     case Mod:is_empty(ModState) of
         true ->
-            io:format("~p dh empty~n",[Idx]),
             delete_and_exit(StateData);
         false ->
-            io:format("~p dh nonempty~n",[Idx]),
             riak_handoff_sender:start_link(TargetNode, Idx, all),
             {next_state,active,StateData#state{handoff_q=[]},?TIMEOUT}
     end.
 do_list_handoff(TargetNode, BKeyList, StateData=#state{idx=Idx}) ->
     case BKeyList of
         [] ->
-            io:format("~p dLh empty~n",[Idx]),
             delete_and_exit(StateData);
         _ ->
-            io:format("~p dLh nonempty~n",[Idx]),
             riak_handoff_sender:start_link(TargetNode, Idx, BKeyList),
             {next_state,active,StateData#state{handoff_q=[]},?TIMEOUT}
     end.
 
 %% @private
-delete_and_exit(StateData=#state{idx=Idx,mod=Mod, modstate=ModState}) ->
-    io:format("~p del and exit~n",[Idx]),
+delete_and_exit(StateData=#state{mod=Mod, modstate=ModState}) ->
     ok = Mod:drop(ModState),
     {stop, normal, StateData}.