Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 4091 invoked from network); 7 Feb 2010 23:31:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Feb 2010 23:31:49 -0000 Received: (qmail 97133 invoked by uid 500); 7 Feb 2010 23:31:49 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 97070 invoked by uid 500); 7 Feb 2010 23:31:49 -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 97059 invoked by uid 99); 7 Feb 2010 23:31:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Feb 2010 23:31:49 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Feb 2010 23:31:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 099C6234C4A8 for ; Sun, 7 Feb 2010 15:31:28 -0800 (PST) Message-ID: <1938515668.111511265585488038.JavaMail.jira@brutus.apache.org> Date: Sun, 7 Feb 2010 23:31:28 +0000 (UTC) From: "Mark Hammond (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-86) (CouchDB on Windows) compaction can not be done. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-86?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830792#action_12830792 ] Mark Hammond commented on COUCHDB-86: ------------------------------------- Thanks very much for running with this. I had a bit of a play over the weekend. First, a few comments about the patch itself: * The force_close_file changes in couch_file seem to be unused and should be deleted. * force_close_file in couch_db seems to be poorly named - it actually calls couch_file:delete and best I can tell, makes no attempt at closing the file at all. * couch_file:delete now seems to be mis-named - it only does a deletion on non-Windows platforms. I wonder if the logic for checking Windows shouldn't just go in couch_db, leaving couch_file with less magic and doing what people would expect it to do (ie, expect couch_file:delete to actually delete and may be surprised at the new behaviour. * Some of the functions named in couch_file should probably be renamed, even if they get longer names. eg, delete_all implies from the name if will delete all files from some location, when what it really does it delete all "versioned" files given a base-name. Ditto next_filepath - that problably wants a name closer to 'next_versioned_filepath' * I'm very inexperienced with erlang, but wouldn't it be better to use linked processes rather than using process_flag(trap_exit,true)? Also, the futon tests get further, but still fail for me. The couch log shows: 1> [info] [<0.1606.0>] 127.0.0.1 - - 'GET' /test_suite_db/_changes?filter=changes_filter/conflicted 200 1> =INFO REPORT==== 8-Feb-2010::10:23:32 === {failed_to_delete,["../var/lib/couchdb/test_suite_db.couch.0",{error,eacces}]} 1> [info] [<0.1609.0>] 127.0.0.1 - - 'DELETE' /test_suite_db/ 200 1> [info] [<0.1606.0>] 127.0.0.1 - - 'PUT' /test_suite_db/ 412 1> [error] [<0.1622.0>] ** Generic server <0.1622.0> terminating ** Last message in was {'EXIT',<0.1626.0>,shutdown} ** When Server state == {file,{file_descriptor,prim_file,{#Port<0.4173>,712}}, "../var/lib/couchdb/test_suite_db.couch.0",true, 0} ** Reason for termination == ** {{badmatch,{error,eacces}}, [{couch_file,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]} ... While futon reports # Exception raised: {"error":"file_exists","reason":"The database could not be created, the file already exists."} On the plus side, many tests now pass which failed before, and no stale 'versioned' files appear to have been left behind :) > (CouchDB on Windows) compaction can not be done. > ------------------------------------------------ > > Key: COUCHDB-86 > URL: https://issues.apache.org/jira/browse/COUCHDB-86 > Project: CouchDB > Issue Type: Bug > Components: Build System > Affects Versions: 0.8 > Environment: Windows XP, Erlang/OTP R12B-3 > Reporter: Li Zhengji > Assignee: Paul Joseph Davis > Priority: Blocker > Fix For: 1.0 > > Original Estimate: 5h > Remaining Estimate: 5h > > During compacting, rename the current DB file to a .old file is not allowed on Windows. > A possible workaround for this could be: > 1. Close current DB file (.couch); > 2. Send db_updated to update to use .compact; > 3. After 5sec, delete the .couch file; ---- This is done in a linked process, after that, this process send a message to update_loop; > 4. After received the message in update_loop, close current DB file which is a .compact file, then rename it to .couch; > 5. Finally, db_updated again to use this new .couch file. > Maybe, there would be a "pause" in service? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.