Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6575D44E for ; Tue, 25 Sep 2012 13:51:40 +0000 (UTC) Received: (qmail 94872 invoked by uid 500); 25 Sep 2012 13:51:40 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 94836 invoked by uid 500); 25 Sep 2012 13:51:40 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 94822 invoked by uid 99); 25 Sep 2012 13:51:40 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2012 13:51:40 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E3D833B522; Tue, 25 Sep 2012 13:51:39 +0000 (UTC) From: adamlofts To: dev@couchdb.apache.org Subject: couchdb pull request: Ensure that nuke_dir properly deletes the folder Content-Type: text/plain Message-Id: <20120925135139.E3D833B522@tyr.zones.apache.org> Date: Tue, 25 Sep 2012 13:51:39 +0000 (UTC) GitHub user adamlofts opened a pull request: https://github.com/apache/couchdb/pull/33 Ensure that nuke_dir properly deletes the folder nuke_dir() was calling couch_file:delete() which expects to be passed a file. This pull request splits out a delete_rename() function and adds nuke_dir_sync() to actually remove the folder once it is renamed. There is also a small performance improvement by deleting the folder asynchronously after it has been renamed. The second commit reuses the nuke_dir_sync() function to clean up the .delete folder on startup because it can now contain deleted folders. You can merge this pull request into a Git repository by running: $ git pull https://github.com/adamlofts/couchdb tidy-delete-dir Alternatively you can review and apply these changes as the patch at: https://github.com/apache/couchdb/pull/33.patch ---- commit 58853ae3bd92e837e357991f359cf8673db5b012 Author: Adam Lofts Date: 2012-09-24T04:37:33-07:00 Change nuke_dir to rename the directory and then delete asynchronously couch_file:delete does not expect to be passed a directory and was not properly removing the directory from the .delete folder. commit 1e7ce16f665c1d1335a8cad2504d94c25a58c0dc Author: Adam Lofts Date: 2012-09-24T04:59:22-07:00 Use nuke_dir_sync to clean the .delete directory This is because folders are also deleted by moving to the deleted directory so also need to be removed. ----