anchor.diff:          ?LOG_INFO("Compaction file still behind main file "
               "(update seq=~p. compact update seq=~p). Retrying.",
               [Db#db.update_seq, NewSeq]),
  -        couch_file:close(NewFd),
  +        close_db(NewDb),
           Pid = spawn_link(fun() -> start_copy_compact(Db) end),
           Db2 = Db#db{compactor_pid=Pid},
           {noreply, Db2}
  
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:         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),
  