From: Tomi Ollila Date: Tue, 2 Sep 2014 04:38:41 +0000 (+0300) Subject: Re: [PATCH] lib: Fix endless upgrade problem X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=801242b25d1099d36505ae69df65ed0d64f3af2c;p=notmuch-archives.git Re: [PATCH] lib: Fix endless upgrade problem --- diff --git a/37/a891c6fdef93ca62bd9196f73b37afd631647e b/37/a891c6fdef93ca62bd9196f73b37afd631647e new file mode 100644 index 000000000..b1709384c --- /dev/null +++ b/37/a891c6fdef93ca62bd9196f73b37afd631647e @@ -0,0 +1,92 @@ +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 31F15431FD5 + for ; Mon, 1 Sep 2014 21:39:14 -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 BDgYvTXJ1u0t for ; + Mon, 1 Sep 2014 21:39:06 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 84293431FD2 + for ; Mon, 1 Sep 2014 21:39:06 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id C70DE100090; + Tue, 2 Sep 2014 07:38:41 +0300 (EEST) +From: Tomi Ollila +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH] lib: Fix endless upgrade problem +In-Reply-To: <1409611747-32141-1-git-send-email-amdragon@mit.edu> +References: <1409611747-32141-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.18.1+89~g3785a70 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +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: Tue, 02 Sep 2014 04:39:14 -0000 + +On Tue, Sep 02 2014, Austin Clements wrote: + +> 48db8c8 introduced a disagreement between when +> notmuch_database_needs_upgrade returned TRUE and when +> notmuch_database_upgrade actually performed an upgrade. As a result, +> if a database had a version less than 3, but no new features were +> required, notmuch new would call notmuch_database_upgrade to perform +> an upgrade, but notmuch_database_upgrade would return immediately +> without updating the database version. Hence, the next notmuch new +> would do the same, and so on. +> +> Fix this by ensuring that the upgrade-required logic is identical +> between the two. + +LGTM + +Tomi + +> --- +> lib/database.cc | 2 +- +> 1 file changed, 1 insertion(+), 1 deletion(-) +> +> diff --git a/lib/database.cc b/lib/database.cc +> index 5116188..a3a7cd3 100644 +> --- a/lib/database.cc +> +++ b/lib/database.cc +> @@ -1222,7 +1222,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, +> target_features = notmuch->features | NOTMUCH_FEATURES_CURRENT; +> new_features = NOTMUCH_FEATURES_CURRENT & ~notmuch->features; +> +> - if (! new_features) +> + if (! notmuch_database_needs_upgrade (notmuch)) +> return NOTMUCH_STATUS_SUCCESS; +> +> if (progress_notify) { +> -- +> 2.0.0 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch