anchor.diff:          revs_limit = Header#db_header.revs_limit
           }.
   
  +
  +close_db(#db{ fd_ref_counter = RefCntr, summary_stream = SummaryStream}) ->
  +    couch_stream:close(SummaryStream),
  +    couch_ref_counter:drop(RefCntr).
  +    
   
   refresh_validate_doc_funs(Db) ->
       {ok, DesignDocs} = get_design_docs(Db),
  
positive.code:         ok = couch_file:write_header(Fd, ?HEADER_SIG, Header=#db_header{})
      end,
      NewDb = init_db(Name, CompactFile, Fd, Header),
      _NewDb2 = copy_compact(Db, NewDb, Retry),
      
      gen_server:cast(Db#db.update_pid, {compact_done, CompactFile}).
      
  
negative.code:         ?LOG_INFO("Compaction file still behind main file "
              "(update seq=~p. compact update seq=~p). Retrying.",
              [Db#db.update_seq, NewSeq]),
          close_db(NewDb),
          Pid = spawn_link(fun() -> start_copy_compact(Db) end),
          Db2 = Db#db{compactor_pid=Pid},
          {noreply, Db2}
  