anchor.diff:          false ->
               ok
       end,
  -    {Server, DbName};
  -changes_reader_cb({stop, EndSeq, _Pending}, _, {Server, DbName}) ->
  +    {Server, DbName, Epoch};
  +changes_reader_cb({stop, EndSeq, _Pending}, _, {Server, DbName, Epoch}) ->
       Msg = {rep_db_checkpoint, DbName, EndSeq},
       ok = gen_server:call(Server, Msg, infinity),
  -    {Server, DbName};
  +    {Server, DbName, Epoch};
   changes_reader_cb(_, _, Acc) ->
       Acc.
   
  
positive.code:     {ok, State}.
  
  
  start_changes_reader(DbName, Since) ->
      spawn_link(?MODULE, changes_reader, [self(), DbName, Since]).
  
  changes_reader(Server, DbName, Since) ->
      UserCtx = #user_ctx{roles = [<<"_admin">>, <<"_replicator">>]},
      DbOpenOptions = [{user_ctx, UserCtx}, sys_db],
      {ok, Db} = couch_db:open_int(DbName, DbOpenOptions),
  
negative.code:             {DbName, EndSeq, Rescan}
      end,
      true = ets:insert(?DB_TO_SEQ, Entry),
      {reply, ok, State};
  
  % Ignore checkpoints from previous epoch.
  handle_call({rep_db_checkpoint, _DbName, _EndSeq, _Epoch}, _From, State) ->
      {reply, ok, State};
  
  handle_call(Msg, From, State) ->
  