From: Mark Walters Date: Tue, 2 Sep 2014 06:11:43 +0000 (+0100) Subject: Re: [PATCH] lib: Fix endless upgrade problem X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=787840d824125925a9ac1a6814f38563e2574af0;p=notmuch-archives.git Re: [PATCH] lib: Fix endless upgrade problem --- diff --git a/08/6f81e81df973a435e6130eaff0827f9f2edaa2 b/08/6f81e81df973a435e6130eaff0827f9f2edaa2 new file mode 100644 index 000000000..d7f7e44d1 --- /dev/null +++ b/08/6f81e81df973a435e6130eaff0827f9f2edaa2 @@ -0,0 +1,127 @@ +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 0A06E431FD7 + for ; Mon, 1 Sep 2014 23:12:18 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.502 +X-Spam-Level: +X-Spam-Status: No, score=0.502 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_LOW=-0.7] 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 yti6xLkKhGEY for ; + Mon, 1 Sep 2014 23:12:10 -0700 (PDT) +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 26751431FD2 + for ; Mon, 1 Sep 2014 23:12:10 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1XOhJh-0003V4-19; Tue, 02 Sep 2014 07:12:05 +0100 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1XOhJg-00075s-Eq; Tue, 02 Sep 2014 07:11:44 +0100 +From: Mark Walters +To: Tomi Ollila , Austin Clements , + notmuch@notmuchmail.org +Subject: Re: [PATCH] lib: Fix endless upgrade problem +In-Reply-To: +References: <1409611747-32141-1-git-send-email-amdragon@mit.edu> + +User-Agent: Notmuch/0.15.2+803~ge083086 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Tue, 02 Sep 2014 07:11:43 +0100 +Message-ID: <871truo8kg.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 87.81.223.162 +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: d30a5159a6dcb1db78ef6ad8e3abd159 (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +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.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 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: Tue, 02 Sep 2014 06:12:18 -0000 + + +On Tue, 02 Sep 2014, Tomi Ollila wrote: +> 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 + +and me +1 + +Mark + + +> +> 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 +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch