anchor.diff:  
   maybe_adjust_all_replications(BucketConfigs) ->
       lists:foreach(
  -        fun([XDocId,
  -             #rep{source = SrcBucket,
  -                  target = {_, TgtBucket, _, _, _, _, _, _, _, _}},
  -             PrevTriggeredVbs,
  -             PrevUntriggeredVbs]) ->
  +        fun([XDocId, #rep{source = SrcBucket}, PrevVbs]) ->
               SrcBucketConfig =
                   proplists:get_value(?b2l(SrcBucket), BucketConfigs),
               CurrVbs = xdc_rep_utils:my_active_vbuckets(SrcBucketConfig),
  -            maybe_adjust_xdc_replication(
  -                XDocId, SrcBucket, TgtBucket, PrevTriggeredVbs,
  -                PrevUntriggeredVbs, CurrVbs)
  +            maybe_adjust_xdc_replication(XDocId, PrevVbs, CurrVbs)
           end,
  -        ets:match(?XSTORE, {'$1', '$2', '$3', '$4'})).
  -
  -
  -maybe_adjust_xdc_replication(XDocId, SrcBucket, TgtBucket, PrevTriggeredVbs,
  -                             PrevUntriggeredVbs, CurrVbs) ->
  -    PrevVbs = PrevTriggeredVbs ++ PrevUntriggeredVbs,
  -    {AcquiredVbs, LostVbs} = xdc_rep_utils:lists_difference(CurrVbs, PrevVbs),
  -
  -    % Start Couch replications for the newly acquired vbuckets
  -    {ok, {TgtVbMap, TgtNodes}} =
  -        xdc_rep_utils:remote_vbucketmap_nodelist(TgtBucket),
  -    {TriggeredVbs1, UntriggeredVbs1} = start_vbucket_replications(
  -        XDocId, SrcBucket, TgtVbMap, TgtNodes, AcquiredVbs, 0),
  -
  -    % Add entries for the new Couch replications to the replication info doc
  -    couch_replication_manager:update_rep_doc(
  -        xdc_rep_utils:info_doc_id(XDocId),
  -        xdc_rep_utils:vb_rep_state_list(TriggeredVbs1, <<"triggered">>)),
  +        ets:match(?XSTORE, {'$1', '$2', '$3'})).
  +
  +
  +maybe_adjust_xdc_replication(XDocId, PrevVbs, CurrVbs) ->
  +    {_AcquiredVbs, LostVbs} = xdc_rep_utils:lists_difference(CurrVbs, PrevVbs),
   
       % Cancel Couch replications for the lost vbuckets
       CRepPidsToCancel =
  
positive.code:              {<<"replication_fields">>, XDocBody},
               {<<"source">>, <<"">>},
               {<<"target">>, <<"">>} |
               AllVbStates
              ]},
  
      case couch_db:open_doc(RepDb, IDocId, [ejson_body]) of
  
negative.code:         error:badarg ->
              []
          end,
      [{CRepPid} ||
          {CRepPid, _CRep, _, State} <-
              lists:flatten([(ets:lookup(?CSTORE, Pid)) || Pid <- Pids]),
          State == triggered].
  
  
  %
  % XDC replication and replication info document related functions
  %
  
  create_xdc_rep_info_doc(XDocId, {Base, Ext}, Vbs, RepDbName, XDocBody) ->
      IDocId = xdc_rep_utils:info_doc_id(XDocId),
      UserCtx = #user_ctx{roles = [<<"_admin">>, <<"_replicator">>]},
      {ok, RepDb} = couch_db:open(RepDbName, [sys_db, {user_ctx, UserCtx}]),
  
      VbStates =  xdc_rep_utils:vb_rep_state_list(Vbs, <<"undefined">>),
      Body = {[
               {<<"node">>, xdc_rep_utils:node_uuid()},
               {<<"replication_doc_id">>, XDocId},
  