anchor.diff:      TgtDb = xdc_rep_utils:parse_rep_db(TgtURI, [], [{xdcr_cert, CertPEM} | Options]),
       {ok, Target} = couch_api_wrap:db_open(TgtDb, []),
   
  -    SrcMasterDb = capi_utils:must_open_master_vbucket(Src),
  -
       XMemRemote = case RepMode of
                        "xmem" ->
                            {ok, #remote_node{host = RemoteHostName, memcached_port = Port} = RN, LatestRemoteBucket} =
  
positive.code:     ResultState = NewState#rep_state{
                      changes_queue = ChangesQueue,
                      workers = Workers,
                      src_master_db = SrcMasterDb,
                      target_name = TgtURI,
                      target = Target,
                      timer = xdc_vbucket_rep_ckpt:start_timer(State),
  
negative.code: 
  terminate_cleanup(State0) ->
      State = xdc_vbucket_rep_ckpt:cancel_timer(State0),
      Dbs = [State#rep_state.target],
      [catch couch_api_wrap:db_close(Db) || Db <- Dbs, Db /= undefined].
  
  
  