From 645526fe5f580455049e63d4d6ab1ac03bdb2213 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Mon, 18 May 2009 00:50:12 +0000 Subject: remove leftover .compact files on DB delete git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@775785 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_server.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl index c1908629..3bf59724 100644 --- a/src/couchdb/couch_server.erl +++ b/src/couchdb/couch_server.erl @@ -303,6 +303,11 @@ handle_call({delete, DbName, _Options}, _From, Server) -> true = ets:delete(couch_dbs_by_lru, LruTime), Server#server{dbs_open=Server#server.dbs_open - 1} end, + + %% Delete any leftover .compact files. If we don't do this a subsequent + %% request for this DB will try to open the .compact file and use it. + file:delete(FullFilepath ++ ".compact"), + case file:delete(FullFilepath) of ok -> couch_db_update_notifier:notify({deleted, DbName}), -- cgit v1.2.3