unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org
Subject: automatic database upgrades (was: Re: [PATCH 0/7] cli: notmuch new improvements)
Date: Sat, 25 Jan 2014 16:59:12 +0200	[thread overview]
Message-ID: <87lhy4f6pr.fsf@nikula.org> (raw)
In-Reply-To: <87ppnga21o.fsf@qmul.ac.uk>

On Sat, 25 Jan 2014, Mark Walters <markwalters1009@gmail.com> 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 <cworth@cworth.org>
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 <foo>.". If command <foo> 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.

  reply	other threads:[~2014-01-25 14:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-19 20:32 [PATCH 0/7] cli: notmuch new improvements Jani Nikula
2014-01-19 20:32 ` [PATCH 1/7] cli: extract single message addition in notmuch new to clarify code Jani Nikula
2014-01-19 20:32 ` [PATCH 2/7] cli: only check the ignore list if needed Jani Nikula
2014-01-19 20:32 ` [PATCH 3/7] cli: use dirent_type in count_files too Jani Nikula
2014-01-19 20:32 ` [PATCH 4/7] cli: for loop is more customary Jani Nikula
2014-01-19 20:32 ` [PATCH 5/7] cli: abstract notmuch new result printing Jani Nikula
2014-01-19 20:32 ` [PATCH 6/7] cli: add --quiet option to notmuch new Jani Nikula
2014-01-24  8:58   ` Mark Walters
2014-01-24  9:54     ` Jani Nikula
2014-01-19 20:32 ` [PATCH 7/7] man: document notmuch new --quiet option Jani Nikula
2014-01-25  8:38 ` [PATCH 0/7] cli: notmuch new improvements Mark Walters
2014-01-25 14:59   ` Jani Nikula [this message]
2014-01-25 17:32     ` automatic database upgrades (was: Re: [PATCH 0/7] cli: notmuch new improvements) Mark Walters
2014-01-25 19:29       ` Jani Nikula
2014-01-25 17:29 ` [PATCH 0/7] cli: notmuch new improvements Tomi Ollila
2014-01-26 14:06 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhy4f6pr.fsf@nikula.org \
    --to=jani@nikula.org \
    --cc=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).