Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5896C431FBC for ; Thu, 12 Jun 2014 15:56:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cb9Hyb535ZHO for ; Thu, 12 Jun 2014 15:56:46 -0700 (PDT) Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7D719431FAF for ; Thu, 12 Jun 2014 15:56:46 -0700 (PDT) Received: from remotemail by yantan.tethera.net with local (Exim 4.80) (envelope-from ) id 1WvDvC-0000Ba-9d; Thu, 12 Jun 2014 19:56:38 -0300 Received: (nullmailer pid 21038 invoked by uid 1000); Thu, 12 Jun 2014 22:56:34 -0000 From: David Bremner To: Mark Walters , Maarten Aertsen , notmuch@notmuchmail.org Subject: Re: notmuch dump: taking write-lock to protect from concurrent (cronned) notmuch new? In-Reply-To: <878upafegc.fsf@qmul.ac.uk> References: <20140606080354.28047.77393@kardo.rtsn.nl> <878upafegc.fsf@qmul.ac.uk> User-Agent: Notmuch/0.18 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Jun 2014 19:56:34 -0300 Message-ID: <87mwdhg2jh.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jun 2014 22:56:50 -0000 Mark Walters writes: >> mjw1009 suggested to change NOTMUCH_DATABASE_MODE_READ_ONLY on line >> 215 of notmuch-dump.c to NOTMUCH_DATABASE_MODE_READ_WRITE >> >> I'm wondering if this hits enough people to motivate the addition of a >> command line switch (or perhaps even a change in default behaviour?) > > I think this is a clear bug but the fix is a little unclear. The above > fix works but it breaks one of the tests: "unicode message-ids" in > T150-tagging.sh. > > I think the problem is that it does > notmuch dump | sed... | notmuch restore > My first reaction was "argh, we should be locking things less, not more". But then I read http://getting-started-with-xapian.readthedocs.org/en/latest/xapian-core-rst/admin_notes.html?highlight=backup#id10 and now I'm not so sure, maybe write lock for dump is the right answer. It seems hard to do anything sensible with "Database.reopen" in the context of a backup.