Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 94886 invoked from network); 23 Jun 2010 16:24:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Jun 2010 16:24:18 -0000 Received: (qmail 83867 invoked by uid 500); 23 Jun 2010 16:24:17 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 83744 invoked by uid 500); 23 Jun 2010 16:24:16 -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 83736 invoked by uid 99); 23 Jun 2010 16:24:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jun 2010 16:24:16 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.newson@gmail.com designates 74.125.82.52 as permitted sender) Received: from [74.125.82.52] (HELO mail-ww0-f52.google.com) (74.125.82.52) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jun 2010 16:24:08 +0000 Received: by wwb13 with SMTP id 13so533309wwb.11 for ; Wed, 23 Jun 2010 09:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=jJpr3qAXZoDKLD159gFoK/gX2qAcZXRx8+wfFFQOv0I=; b=Yy+ikB5U/NxGMCIBdU3SvPEcNq6tPTsda9pjwgEDF8xLt5fQTjKeAenPb08D6ncTxG iPnjXU6jGciiUgMZ6oWcblHqvMv3cSOtyJJDe/sCKNrFP9otGjbLG/6N3HMOX+tiLnzp G3WL2frr5QTjzZti8BKWAyFfuF8VhnD9irdlM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TgE4KLYUz7TxtndUsWvBnp2HklxQwlgACYlmuM10Kaz40NXWS6l8O4t5Pd3bId5uDq DeEwnPrWi72nhduisStJyKQKpGImFmvnhCbSaiuJvC/1Pfr4hQ80Yxgxr2Q8v6qddb42 9c25e3dTSrjBgPoQYu1HbcFzwprIldhzhuyOk= MIME-Version: 1.0 Received: by 10.227.69.200 with SMTP id a8mr7877618wbj.30.1277310228007; Wed, 23 Jun 2010 09:23:48 -0700 (PDT) Received: by 10.216.51.3 with HTTP; Wed, 23 Jun 2010 09:23:47 -0700 (PDT) Date: Wed, 23 Jun 2010 17:23:47 +0100 Message-ID: Subject: Recovering from failed compaction due to lack of disk space. From: Robert Newson To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Couchdb can make a .compact file when the volume is almost out of disk space and then crash before writing the header. If you then clean some space and try to compact again, it won't ever work. [Wed, 23 Jun 2010 16:11:59 GMT] [error] [emulator] Error in process <0.1976.0> with exit value: {{badmatch,no_valid_header},[{couch_db_updater,start_copy_compact,1}]} The presence of the invalid .compact file prevents it, and needs to be manually removed. I think couchdb should handle this but it's clearly a dangerous area to play with. My suggestion is to change the bit of code that tests for the .compact file's presence to also verify that it's not 0 bytes in length (and delete the file if it is). Is that dangerous? Should it cover other similar cases? B.