anchor.diff:              fun(Vb) ->
                   {?l2b("replication_state_vb_" ++ ?i2l(Vb)), <<"triggered">>}
               end,
  -            VbucketsAcquired)),
  +            (AcquiredVbuckets -- FailedVbuckets))),
   
       % Cancel Couch replications for the lost vbuckets
       CRepPidsToCancel =
           try
               [CRepPid || CRepPid <- ets:lookup_element(?X2CSTORE, XDocId, 2),
                           lists:member(ets:lookup_element(?CSTORE, CRepPid, 3),
  -                                     VbucketsLost)]
  +                                     LostVbuckets)]
           catch error:badarg ->
               []
           end,
  
positive.code:         {error, not_present};
      {{ok, SrcBucketConfig}, {ok, {TgtVbMap, TgtNodes}}} ->
          MyVbuckets = xdc_rep_utils:my_active_vbuckets(SrcBucketConfig),
          lists:map(
              fun(Vb) ->
                  SrcURI = xdc_rep_utils:local_couch_uri_for_vbucket(
                      SrcBucket, Vb),
                  TgtURI = xdc_rep_utils:remote_couch_uri_for_vbucket(
                      TgtVbMap, TgtNodes, Vb),
                  start_couch_replication(SrcURI, TgtURI, Vb, XDocId, 0)
              end,
              MyVbuckets),
          true = ets:insert(?XSTORE, {XDocId, XRep, MyVbuckets}),
          create_xdc_rep_info_doc(XDocId, XRepId, MyVbuckets, RepDbName, XDocBody),
          ok
      end.
  
  
negative.code:             fun(Vb) ->
                  {?l2b("replication_state_vb_" ++ ?i2l(Vb)), <<"cancelled">>}
              end,
              LostVbuckets)),
  
      % Update XSTORE with the current active vbuckets list
      true = ets:update_element(?XSTORE, XDocId,
                                {3, (CurrVbuckets -- FailedVbuckets)}).
  
  
  %
  