anchor.diff:              {reply, {error, {C, E}}, State}
       end;
   
  -handle_call({prepare, {new_shard_info, NewShardInfo}}, _From, State) ->
  -    {reply, prepare_new_shard_info(NewShardInfo), State};
  +handle_call({prepare, {new_shard_info, NewShardInfo}}, From, State=#state{ maps=TempTable0, reply_to=undefined }) ->
  +    TempTable = prepare_new_shard_info(TempTable0, NewShardInfo),
  +    {noreply, State#state{ maps=TempTable, reply_to=From }, 30000};
  +
  +handle_call({prepare, {new_shard_info, _}}, _From, State) ->
  +    {reply, {error, inprogress}, State};
   
   handle_call({make_permanent, new_shard_info}, _From, State) ->
       try
  
positive.code: %% Description: Handling call messages
  %% @hidden
  %%--------------------------------------------------------------------
  handle_call({register_worker, {WorkerType, Url, Reader}}, {From, _Ref}, State = #state{ maps=Maps }) ->
      {WorkerType, Ring} = lists:keyfind(WorkerType, 1, Maps),
      Ring1 = case lists:keyfind(Url, 1, Ring) of
                 {Url, {async, From}} ->
                     lists:keyreplace(Url, 1, Ring, {Url, Reader});
                 _ -> Ring
             end,
      Ring2 = lists:map(fun ({Frag, {async, _}}) ->
                                {Frag, undefined};
                            ({_Frag, Pool}=Mapping) when is_pid(Pool) ->
                                Mapping
                        end, Ring1),
      io:format("RING2 ~p~n", [Ring2]),
      {ok, Map, Interval} = redis_shard:generate_map_and_interval(Ring2),
      io:format("~p ~p ~p~n", [WorkerType, Map, Interval]),
      logplex_shard_info:save(WorkerType, Map, Interval),
      Maps1 = lists:keyreplace(WorkerType, 1, Maps, {WorkerType, Ring1}),
      {reply, ok, State#state{ maps=Maps1 }};
  
  handle_call({commit, new_shard_info}, _From, State) ->
      backup_shard_info(),
  
negative.code: -define(CURRENT_WRITE_MAP, logplex_redis_buffer_map).
  -define(BACKUP_WRITE_MAP, backup_logplex_redis_buffer_map).
  
  -record(state, {urls :: list(),
                  maps = dict:new(),
                  reply_to = undefined :: {pid(), reference()}}).
  
  -define(TIMEOUT, 30000).
  
  