anchor.diff:  
   
   maybe_flush_docs(#httpdb{} = Target,
  -    #batch{docs = DocAcc, size = SizeAcc} = Batch, #doc{atts = Atts} = Doc) ->
  -    case (length(Atts) > ?MAX_BULK_ATTS_PER_DOC) orelse
  -        lists:any(
  -            fun(A) -> A#att.disk_len > ?MAX_BULK_ATT_SIZE end, Atts) of
  -    true ->
  +    #batch{docs = DocAcc, size = SizeAcc} = Batch, Doc) ->
  +    case batch_doc(Doc) of
  +    false ->
           ?LOG_DEBUG("Worker flushing doc with attachments", []),
           case flush_doc(Target, Doc) of
           ok ->
  
positive.code:     end.
  
  
  local_doc_handler({ok, #doc{atts = []} = Doc}, {Target, DocList, W, F}) ->
      {Target, [Doc | DocList], W, F};
  local_doc_handler({ok, Doc}, {Target, DocList, W, F}) ->
      ?LOG_DEBUG("Worker flushing doc with attachments", []),
      Target2 = open_db(Target),
      Success = (flush_doc(Target2, Doc) =:= ok),
      close_db(Target2),
      case Success of
      true ->
          {Target, DocList, W + 1, F};
      false ->
          {Target, DocList, W, F + 1}
      end;
  local_doc_handler(_, Acc) ->
      Acc.
  
negative.code:         _ ->
              {Batch, 0, 1}
          end;
      true ->
          JsonDoc = ?JSON_ENCODE(couch_doc:to_json_obj(Doc, [revs, attachments])),
          case SizeAcc + iolist_size(JsonDoc) of
          SizeAcc2 when SizeAcc2 > ?DOC_BUFFER_BYTE_SIZE ->
  