anchor.diff:                                      dict:store(TargetNode, NewLoad, TargetLoad)
                               end,
   
  -            ?xdcr_debug("schedule a waiting rep (pid: ~p, target node: ~p) to be active",
  -                        [WaitingPid, TargetNode]),
  +            ?xdcr_debug("schedule a waiting rep (pid: ~p, target node: ~p) to be active "
  +                        "(active reps: ~p, waiting reps: ~p)",
  +                        [WaitingPid, TargetNode, dict:size(NewActivePool), dict:size(NewWaitingPool)]),
   
               WaitingPid ! Signal,
               State#concurrency_throttle_state{
  
positive.code:                  waiting_pool = NewWaitingPool},
  
      ?xdcr_debug("no token available, put (pid:~p, signal: ~p, targetnode: ~p) "
                  "waiting pool", [Pid, Signal, TargetNode]),
  
      {reply, ok, NewState};
  
  
negative.code: 
      {Signal, TargetNode} = dict:fetch(MinimumPid, WaitingPool),
      {MinimumPid, Signal, TargetNode}.
  
  
  clean_concurr_throttle_state(Pid, Reason, #concurrency_throttle_state{
                                 count = Count, monitor_dict = MonDict,
                                 active_pool = ActivePool, waiting_pool = WaitingPool,
                                 target_load = TargetLoad } = State) ->
      %% update monitoring and active reps dictionaries
      NewMonDict = dict:erase(Pid, MonDict),
      NewActivePool = dict:erase(Pid, ActivePool),
      %% update target_load dict
      TargetNode = dict:fetch(Pid, ActivePool),
      NewLoad = dict:fetch(TargetNode, TargetLoad) - 1,
      NewTargetLoad = case NewLoad > 0 of
                          true ->
                              dict:store(TargetNode, NewLoad, TargetLoad);
                          _ ->
                              dict:erase(TargetNode, TargetLoad)
                      end,
      %% update token counter
      NewCount = Count + 1,
  
      NewState =  State#concurrency_throttle_state{
                    count = NewCount,
                    monitor_dict = NewMonDict,
                    active_pool = NewActivePool,
                    target_load = NewTargetLoad},
  
      case Reason of
          normal  ->
              ?xdcr_debug("rep ~p to node ~p is done normally, available tokens: ~p,"
                          "(active reps: ~p, waiting reps: ~p)",
                          [Pid, TargetNode, NewCount,
                           dict:size(NewActivePool), dict:size(WaitingPool)]);
          {Type, Info} ->
              ?xdcr_debug("rep ~p to node ~p crashed (type: ~p, info: ~p), available tokens: ~p, "
                          "(active reps: ~p, waiting reps: ~p)",
                          [Pid, TargetNode, Type, Info, NewCount,
                           dict:size(NewActivePool), dict:size(WaitingPool)])
      end,
      NewState.
  