diff options
author | Damien F. Katz <damien@apache.org> | 2010-06-23 18:59:42 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2010-06-23 18:59:42 +0000 |
commit | 918f8bf54a4aeffc3c0ef4ad1fa31ce93bbc1346 (patch) | |
tree | 5eee278fccc23e7ab893e8cf0b356db839d15677 /src/couchdb/couch_db_updater.erl | |
parent | f5fad72d00f5f3f0b38473898bb3683683a6cc49 (diff) |
Make file deletions async to avoid pauses during compaction and db deletion. Fixes COUCHDB-780.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957303 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db_updater.erl')
-rw-r--r-- | src/couchdb/couch_db_updater.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl index 9a5476e8..c7c78dd2 100644 --- a/src/couchdb/couch_db_updater.erl +++ b/src/couchdb/couch_db_updater.erl @@ -27,7 +27,7 @@ init({MainPid, DbName, Filepath, Fd, Options}) -> Header = #db_header{}, ok = couch_file:write_header(Fd, Header), % delete any old compaction files that might be hanging around - file:delete(Filepath ++ ".compact"); + couch_file:delete(Filepath ++ ".compact"); false -> ok = couch_file:upgrade_old_header(Fd, <<$g, $m, $k, 0>>), % 09 UPGRADE CODE {ok, Header} = couch_file:read_header(Fd) @@ -171,7 +171,7 @@ handle_cast({compact_done, CompactFilepath}, #db{filepath=Filepath}=Db) -> ?LOG_DEBUG("CouchDB swapping files ~s and ~s.", [Filepath, CompactFilepath]), - file:delete(Filepath), + couch_file:delete(Filepath), ok = file:rename(CompactFilepath, Filepath), close_db(Db), ok = gen_server:call(Db#db.main_pid, {db_updated, NewDb2}), |