--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 1F79F431FC0\r
+ for <notmuch@notmuchmail.org>; Tue, 15 Jul 2014 23:51:15 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.502\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.502 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7] 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 hI9ybJZr3EGN for <notmuch@notmuchmail.org>;\r
+ Tue, 15 Jul 2014 23:51:07 -0700 (PDT)\r
+Received: from mail1.qmul.ac.uk (mail1.qmul.ac.uk [138.37.6.7])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id DBFCD431FBD\r
+ for <notmuch@notmuchmail.org>; Tue, 15 Jul 2014 23:51:06 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail1.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1X7J3N-0005fj-Ba; Wed, 16 Jul 2014 07:51:01 +0100\r
+Received: from [194.42.225.51] (helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1X7J3N-0004w5-5d; Wed, 16 Jul 2014 07:51:01 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] dump: make dump take Xapian write lock\r
+In-Reply-To: <87y4vuaf10.fsf@maritornes.cs.unb.ca>\r
+References: <87zjhh67e7.fsf@qmul.ac.uk>\r
+ <1403554349-8888-1-git-send-email-markwalters1009@gmail.com>\r
+ <87y4vuaf10.fsf@maritornes.cs.unb.ca>\r
+User-Agent: Notmuch/0.15.2+615~g78e3a93 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Wed, 16 Jul 2014 07:50:41 +0100\r
+Message-ID: <871ttlztj2.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-QM-SPAM-Info: 194.42.225.51 is in Janet mirror of Spamhaus XBL;\r
+ see http://www.spamhaus.org/xbl/\r
+X-Sender-Host-Address: 194.42.225.51\r
+X-QM-Geographic: According to ripencc,\r
+ this message was delivered by a machine in Britain (UK) (GB).\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 402ab17fd2c5d35e4d7b1c38f424c9e1 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.1\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.1 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.1 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Wed, 16 Jul 2014 06:51:15 -0000\r
+\r
+\r
+On Tue, 15 Jul 2014, David Bremner <david@tethera.net> wrote:\r
+> Mark Walters <markwalters1009@gmail.com> writes:\r
+>\r
+>>\r
+>> Discussion with Olly on irc indicates that this is currently the best\r
+>> solution: in xapian trunk there may be better possibilities using\r
+>> snapshots but they need to make it to a release and propogate out to\r
+>> users before we can switch approach.\r
+>\r
+> I agree that this seems to be the only feasible approach to make dump\r
+> atomic. I'm a little unsure about the benefits to the end user though.\r
+> Currently, the user has to check the return code of dump to ensure it\r
+> completed correctly. With this change, the user will still have to\r
+> check that dump did not error out when trying to acquire a write lock.\r
+> The following ticket\r
+>\r
+> http://trac.xapian.org/ticket/275\r
+>\r
+> suggests that if we wanted to a blocking open, we'd be on our own.\r
+>\r
+> Did I miss something here about the benefits? I agree that failing\r
+> earlier is nicer, but is that it?\r
+\r
+You are correct that we may still fail. I think there are two\r
+advantages in addition to failing earlier. \r
+\r
+First, I think that if the dump fails there will not be any output file:\r
+I think the old version would leave a partial dump (note I haven't\r
+checked that carefully). This makes it more likely the failing dump is\r
+noticed.\r
+\r
+Secondly, this version will only fail if the database is being written\r
+to when it starts: the old version would fail if something attempted to\r
+write to it at any point during the dump, which can be relatively\r
+lengthy. This should at least reduce the frequency of problems.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r