anchor.diff:  -include("riak_core_vnode.hrl").
   -include("riak_core_handoff.hrl").
   -define(ACK_COUNT, 1000).
  +%% can be set with env riak_core, handoff_timeout
  +-define(TCP_TIMEOUT, 60000).
   
   start_link(TargetNode, Module, Partition, VnodePid) ->
       SslOpts = get_handoff_ssl_options(),
  
positive.code:                     {error, Reason}}) ->
      {Socket, ParentPid, Module, TcpMod, Ack, Total, {error, Reason}};
  visit_item(K, V, {Socket, ParentPid, Module, TcpMod, ?ACK_COUNT, Total, _Err}) ->
      RecvTimout = get_handoff_receive_timeout(),
      M = <<?PT_MSG_OLDSYNC:8,"sync">>,
      case TcpMod:send(Socket, M) of
          ok ->
              case TcpMod:recv(Socket, 0, RecvTimout) of
                  {ok,[?PT_MSG_OLDSYNC|<<"sync">>]} ->
                      visit_item(K, V, {Socket, ParentPid, Module, TcpMod, 0, Total, ok});
                  {error, Reason} ->
  
negative.code:                          lager:debug("~p ~p Sending final sync", [Partition, Module]),
                           ok = TcpMod:send(Socket, <<?PT_MSG_SYNC:8>>),
  
                           case TcpMod:recv(Socket, 0, RecvTimeout) of
                               {ok,[?PT_MSG_SYNC|<<"sync">>]} ->
                                   lager:debug("~p ~p Final sync received", [Partition, Module]);
                               {error, timeout} -> exit({shutdown, timeout})
  