anchor.diff:               {<<"replication_fields">>, XDocBody},
                {<<"source">>, <<"">>},
                {<<"target">>, <<"">>} |
  -             lists:map(
  -                fun(Vb) ->
  -                    {?l2b("replication_state_vb_" ++ ?i2l(Vb)),
  -                     <<"triggered">>}
  -                end,
  -                Vbuckets)
  +             AllVbStates
               ]},
  +
       case couch_db:open_doc(RepDb, IDocId, [ejson_body]) of
       {ok, LatestIDoc} ->
           couch_db:update_doc(RepDb, LatestIDoc#doc{body = Body}, []);
  
positive.code:         couch_db:update_doc(RepDb, #doc{id = IDocId, body = Body}, [])
      end,
  
      couch_replication_manager:update_rep_doc(
          IDocId, [{<<"_replication_state">>, <<"triggered">>}]),
      couch_db:close(RepDb),
  
      ?log_info("~s: created replication info doc ~s", [XDocId, IDocId]),
  
negative.code:             XDocId, SrcBucket, TgtVbMap, TgtNodes, MyVbs, 0),
          true = ets:insert(?XSTORE, {XDocId, XRep, TriggeredVbs,
                                      UntriggeredVbs}),
          create_xdc_rep_info_doc(XDocId, XRepId, TriggeredVbs, UntriggeredVbs,
                                  RepDbName, XDocBody),
          ok
      end.
  
  