anchor.diff:      {Missing, MissingBigDocCount} =
           case length(BigDocIdRevs) of
               V when V > 0 ->
  -                MissingBigIdRevs = find_missing_helper(Target, BigDocIdRevs, XMemSrv),
  +                MissingBigIdRevs = find_missing_helper(Target, BigDocIdRevs, XMemLoc),
                   {lists:flatten([SmallDocIdRevs | MissingBigIdRevs]), length(MissingBigIdRevs)};
               _ ->
                   {SmallDocIdRevs, 0}
  
positive.code: local_doc_handler(_, Acc) ->
      {ok, Acc}.
  
  -spec maybe_flush_docs(#httpdb{}, #batch{}, #doc{}, integer(), integer(), integer(), pid() | nil) ->
                                {#batch{}, integer()}.
  maybe_flush_docs(#httpdb{} = Target, Batch, Doc, DataFlushed, BatchSize, BatchItems, nil) ->
      maybe_flush_docs_capi(Target, Batch, Doc, DataFlushed, BatchSize, BatchItems);
  
  maybe_flush_docs(#httpdb{} = _Target, Batch, Doc, DataFlushed, BatchSize, BatchItems, XMemSrv) ->
      maybe_flush_docs_xmem(XMemSrv, Batch, Doc, DataFlushed, BatchSize, BatchItems).
  
  -spec flush_docs_helper(any(), list(), term()) -> ok.
  flush_docs_helper(Target, DocsList, nil) ->
  
negative.code: 
      %% latency in millisecond
      TotalLatency = round(timer:now_diff(now(), Start) div 1000),
      Latency = case XMemLoc of
                    nil ->
                        TotalLatency;
                    _ ->
                        %% xmem is single doc based
                        try (TotalLatency div BigDocCount) of
                            X -> X
                        catch
                            error:badarith -> 0
                        end
                end,
  
  
      RepMode = case XMemLoc of
                    nil ->
                        "capi";
                    _ ->
                        "xmem"
                end,
      ?xdcr_trace("[replication mode: ~p] out of all ~p docs, number of small docs (including dels: ~p) is ~p, "
                  "number of big docs is ~p, threshold is ~p bytes, ~n\t"
  