Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 40601 invoked from network); 15 Dec 2009 06:41:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Dec 2009 06:41:26 -0000 Received: (qmail 51644 invoked by uid 500); 15 Dec 2009 06:41:25 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 51418 invoked by uid 500); 15 Dec 2009 06:41:23 -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 51408 invoked by uid 99); 15 Dec 2009 06:41:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 06:41:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of zhengji.li@gmail.com designates 209.85.216.180 as permitted sender) Received: from [209.85.216.180] (HELO mail-px0-f180.google.com) (209.85.216.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2009 06:41:12 +0000 Received: by pxi10 with SMTP id 10so2739026pxi.13 for ; Mon, 14 Dec 2009 22:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=CL8YtkKNUD9yi86OGEEBJKkuaOkLp7YctfrkxIBiWCg=; b=Q9zvCiOgNJwa3e4hcKkoH7WH/CwDN/e5v5AdPLFZ5ZH9Yp8GXwMFS/JcfhsV9X1C8V +h9SNM8rGDv63ruIVrhO6VwZQlYDBaZwi4OAr/ljs2ZWy7fhjCvWqV+90esAwUUvkQG2 mFFQ5cddy9qGlHvbmJFaTh34WmmXdKtV8q6lU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Plh0G0HtRxd9/mBjikuvJ/rWNIbds12pdJpmqApKPRyvQgeMqz/qF5IrduEawAi6pP YmFIDaMDblWtQ54OcmXfxSVBtnAMoofPYK0y6Lq4DQrrve5WsreaRcrmWuDtmoLIJeCM JoiNvORuvqiKki3daufi03g3rY6gSX4MOBPG0= MIME-Version: 1.0 Received: by 10.141.125.13 with SMTP id c13mr4104275rvn.280.1260859250995; Mon, 14 Dec 2009 22:40:50 -0800 (PST) In-Reply-To: References: <64883581-F4C3-4C01-842E-CFF1DFF26656@apache.org> Date: Tue, 15 Dec 2009 14:40:50 +0800 Message-ID: Subject: Re: Windows support From: Li Zhengji To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I am using 0.10.1 on Erlang/OTP R13B03 on Windows. And I find that things are not that easy. After applying a quick patch to R13B03, DB compaction still fails: Step 1. delete db.couch --> succeed. (note: file db.couch is still opened.) Step 2. rename db.couch.compact to db.couch --> failed (note: but it's ok to rename it to something else) This blog (http://blogs.msdn.com/oldnewthing/archive/2004/06/07/150047.aspx) tells us the implementation of SHARE_DELETE in OS. I suspect that after step 1, db.couch is just hidden and the deletion would happen only after the corresponding Fid is closed, so it's not allowed to rename some other files to db.couch. So I split step 1 into 2 sub-steps: Step 1.1: rename db.couch to db.couch.2. Step 1.2: delete db.couch.2 Now, compaction can work gracefully on my Windows XP box. Hope this information would help. On Thu, Jun 4, 2009 at 9:55 AM, Li Zhengji wrote: > For DB compaction, I think that besides to ask Erlang/OTP team to > modify BEAM VM, a patch to the VM is also easy and possible. > > For example, I have sent a patch to user list: > >> Here is a quick fix for R13B(5.7.1) beam.smp.dll >> (MD5:4c733eaef7f8619cbac0c9a4b84e20d2): >> >> Change the byte at 0xB5720 from 0x03 to 0x07. Enjoy DB compaction. > > -- > Li Zhengji >