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 17F4A431FBD for ; Sat, 25 Jan 2014 09:34:48 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 5RfQtks94255 for ; Sat, 25 Jan 2014 09:34:40 -0800 (PST) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id D1B95431FBC for ; Sat, 25 Jan 2014 09:34:39 -0800 (PST) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1W777i-0003An-LB; Sat, 25 Jan 2014 17:34:32 +0000 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1W776p-00073r-9V; Sat, 25 Jan 2014 17:33:31 +0000 From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: automatic database upgrades (was: Re: [PATCH 0/7] cli: notmuch new improvements) In-Reply-To: <87lhy4f6pr.fsf@nikula.org> References: <87ppnga21o.fsf@qmul.ac.uk> <87lhy4f6pr.fsf@nikula.org> User-Agent: Notmuch/0.15.2+484~gfb59956 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Sat, 25 Jan 2014 17:32:04 +0000 Message-ID: <87fvoc9dd7.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-Geographic: According to ripencc, this message was delivered by a machine in Britain (UK) (GB). X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: fad9b9e59c7a2386aac17b9357b9d26b (of first 20000 bytes) X-SpamAssassin-Score: 0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored 0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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: Sat, 25 Jan 2014 17:34:48 -0000 Thanks for posting this. You are quite right about it being orthogonal to this series so a clear +1 from me for the series. What about a config option? Something like database_auto_upgrade=true/false? I wouldn't have a strong preference which was the default (though I would choose "false" in my own config). I guess we would need a command line --upgrade to allow people with database_auto_upgrade=false to do force/allow the upgrade. Best wishes Mark On Sat, 25 Jan 2014, Jani Nikula wrote: > On Sat, 25 Jan 2014, Mark Walters wrote: >> This series LGTM. > > Hi Mark, thanks for the review! > >> I do now recall there was some discussion on irc about the automatic >> database upgrade: it would be good to have that documented but the >> consensus was to do it, so +1 from me. > > Here's some summary, as promised. Please bear in mind that the > discussion is pretty much irrelevant to this particular patch > series. (We might discuss whether a warning about upgrade should be > printed to stderr also with --quiet, but IMHO that can be a follow-up > patch.) > > A database upgrade is required when the user upgrades to a new version > of notmuch that has a modified database schema. See > id:cover.1389304779.git.jani@nikula.org for an example of a proposed > database change. > > A database upgrade is a rare event. Most of the time, it's okay to go > back and forth with notmuch versions on the same database, but a > database upgrade is an irreversible process after which the user must > use the new version of notmuch. To go back requires a full rebuild of > the database. > > We don't have recent experience with the database upgrades. The last > time it happened was before notmuch 0.1 (yes, 0.1) was released, when > the whole upgrade mechanism was introduced: > > commit 909f52bd8c4bdfa11cd3e75e3d0959e0293689bd > Author: Carl Worth > Date: Thu Jan 7 18:26:31 2010 -0800 > > lib: Implement versioning in the database and provide upgrade function. > > Some of the points in favor of requiring manual intervention (such as > running 'notmuch new --upgrade' or a new command 'notmuch upgrade') > before upgrading the database: > > * The database upgrade is an irreversible process. The user should have > a chance to decide whether to go ahead with that. You can't go back to > the old notmuch and database version without rebuilding the database. > > * The user should be given the chance to make backups first in case > something goes wrong. > > * The database upgrade might take a long time for large databases. The > user should be able to choose when to go ahead with that. > > Some of the points in favor of upgrading automatically: > > * cworth: "One potential concern is that [requiring manual intervention] > effectively breaks notmuch until the user intervenese and runs this > new command. So that can complicate things for any interface that sits > on top of notmuch." > > * cworth: "In general, I'm often frustrated with programs that say "I > cannot continue until you run command .". If command needs > to be run, and the software knows it, why doesn't it just run it > itself? [...] So a message like "Run 'notmuch upgrade'" seems it could > corrode the user's trust in notmuch to maintain its own state." > > * There are people who run notmuch new non-interactively. There's no > easy answer to handling that if manual intervention is required. > > * It should always be okay to kill the upgrade, and continue at a later > time, in case it takes too long. > > Reading the logs again, I'm not so confident about us reaching a > concensus. Maybe it was just me changing my mind during the course of > the discussion... so we can try to reach concensus here. > > > BR, > Jani.