anchor.diff:             after
                  ok = couch_db:close(Db)
              end,
  -    %% anytime we disconnect or reconnect, force a replicate event.
  -    erlang:spawn_link(
  -      fun () ->
  -              ok = net_kernel:monitor_nodes(true),
  -              nodeup_monitoring_loop(Self)
  -      end),
  -    Self ! replicate_newnodes_docs,
  -
  -    %% Explicitly ask all available nodes to send their documents to us
  -    ServerName = capi_ddoc_replication_srv:proxy_server_name(Bucket),
  -    [{ServerName, N} ! replicate_newnodes_docs ||
  -        N <- get_remote_nodes(Bucket)],
  -
  -    Replicator = spawn_ddoc_replicator(ServerName),
   
       State = #state{bucket=Bucket,
                      local_docs = Docs,
  
positive.code:                    rebalance_states = [],
                     ddoc_replicator = Replicator},
  
      proc_lib:init_ack({ok, self()}),
  
      [maybe_define_group(DDocId, State)
       || DDocId <- get_live_ddoc_ids(State)],
  
      gen_server:enter_loop(?MODULE, [], State).
  
  get_live_ddoc_ids(#state{local_docs = Docs}) ->
      [Id || #doc{id = Id, deleted = false} <- Docs].
  
negative.code:     {ok, DDocReplicationProxy} = capi_ddoc_replication_srv:start_link(Bucket),
      erlang:put('ddoc_replication_proxy', DDocReplicationProxy),
  
      %% anytime we disconnect or reconnect, force a replicate event.
      erlang:spawn_link(
        fun () ->
                ok = net_kernel:monitor_nodes(true),
                nodeup_monitoring_loop(Self)
        end),
      Self ! replicate_newnodes_docs,
  
      %% Explicitly ask all available nodes to send their documents to us
      ServerName = capi_ddoc_replication_srv:proxy_server_name(Bucket),
      [{ServerName, N} ! replicate_newnodes_docs ||
          N <- get_remote_nodes(Bucket)],
  
      Replicator = spawn_ddoc_replicator(ServerName),
  
      proc_lib:init_ack({ok, self()}),
  
      wait_for_bucket_to_start(Bucket, 0),
  
      {ok, Db} = open_local_db(Bucket),
      Docs = try
                 {ok, ADocs} = couch_db:get_design_docs(Db, deleted_also),
  