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:                 [Filepath, CompactFilepath]),
          file:delete(Filepath),
          ok = file:rename(CompactFilepath, Filepath),
          
          couch_stream:close(Db#db.summary_stream),
          couch_ref_counter:drop(Db#db.fd_ref_counter),
              
          ok = gen_server:call(Db#db.main_pid, {db_updated, NewDb2}),
          ?LOG_INFO("Compaction for db \"~s\" completed.", [Db#db.name]),
          {noreply, NewDb2#db{compactor_pid=nil}};
  
negative.code:     {ok, NewFd} = couch_file:open(CompactFilepath),
      {ok, NewHeader} = couch_file:read_header(NewFd, ?HEADER_SIG),
      #db{update_seq=NewSeq} = NewDb =
              init_db(Db#db.name, Filepath, NewFd, NewHeader),
      unlink(NewFd),
      case Db#db.update_seq == NewSeq of
      true ->
          % suck up all the local docs into memory and write them to the new db
  