Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 69216 invoked from network); 2 Jan 2011 00:20:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jan 2011 00:20:09 -0000 Received: (qmail 14919 invoked by uid 500); 2 Jan 2011 00:20:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 14877 invoked by uid 500); 2 Jan 2011 00:20:09 -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 14869 invoked by uid 99); 2 Jan 2011 00:20:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jan 2011 00:20:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jan 2011 00:20:07 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id p020JjIb007833 for ; Sun, 2 Jan 2011 00:19:46 GMT Message-ID: <16012339.94641293927585681.JavaMail.jira@thor> Date: Sat, 1 Jan 2011 19:19:45 -0500 (EST) From: "Robert Newson (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-1003) deleting db file is asynchronous & file rename in couch_file:delete In-Reply-To: <6302477.93961293919906761.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976466#action_12976466 ] Robert Newson commented on COUCHDB-1003: ---------------------------------------- We currently do this, synchronous, on a delete db call; 1) close the file descriptors 2) remove the db from the internal ets tables (lru, etc) 3) rename the file to a different directory and name. 4) A fire-and-forget process is then spawned to delete the file. On startup, couchdb deletes everything in the .deleted directory. Spawning a process without waiting for it to complete is perfectly fine if there's nothing to be gained from waiting, as is the case here. I don't see what would be achieved by blocking for the deletion like we used to. > deleting db file is asynchronous & file rename in couch_file:delete > ------------------------------------------------------------------- > > Key: COUCHDB-1003 > URL: https://issues.apache.org/jira/browse/COUCHDB-1003 > Project: CouchDB > Issue Type: Question > Components: Database Core > Reporter: Benoit Chesneau > > I wonder why we spawn the file deletion when we delete a database. On slow io machine it introduces latency. I don't see any reason we make this deletion asynchronous ? > About couch_file:delete, we first rename the file before deleting it. Why are we doing that ? Is this for windows ? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.