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