anchor.diff:          couch_log:notice("Delaying replication `~s` start by ~p seconds.",
               [pp_rep_id(RepId), DelaySecs]),
           Pid = spawn_link(?MODULE, start_replication, [Rep, DelaySecs]),
  -        State#state{rep_start_pids = [Pid | State#state.rep_start_pids]};
  +        State#state{
  +            rep_start_pids = [{rep_start, Pid} | State#state.rep_start_pids]
  +        };
       #rep_state{rep = #rep{doc_id = DocId}} ->
           State;
       #rep_state{starting = false, rep = #rep{db_name = DbName, doc_id = OtherDocId}} ->
  
positive.code:         "~nRestarting replication in ~p seconds.",
          [pp_rep_id(RepId), DocId, to_binary(error_reason(Error)), Wait]),
      Pid = spawn_link(?MODULE, start_replication, [Rep, Wait]),
      State#state{rep_start_pids = [Pid | State#state.rep_start_pids]}.
  
  
  stop_all_replications() ->
  
negative.code:     couch_log:error("Database update notifier died. Reason: ~p", [Reason]),
      {stop, {db_update_notifier_died, Reason}, State};
  
  handle_info({'EXIT', From, Reason}, #state{rep_start_pids = Pids} = State) ->
      case lists:keytake(From, 2, Pids) of
          {value, {DbName, From}, NewPids} ->
              if Reason == normal -> ok; true ->
                  Fmt = "~s : Known replication pid ~w died :: ~w",
                  couch_log:error(Fmt, [?MODULE, From, Reason])
              end,
              NewState = State#state{rep_start_pids = NewPids},
              case ets:lookup(?DB_TO_SEQ, DbName) of
                  [{DbName, _EndSeq, true}] ->
                      handle_cast({resume_scan, DbName}, NewState);
                  _ ->
                      {noreply, NewState}
              end;
          false when Reason == normal ->
              {noreply, State};
          false ->
              Fmt = "~s : Unknown pid ~w died :: ~w",
              couch_log:error(Fmt, [?MODULE, From, Reason]),
  