From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2IOwICE/omCXFAAAgWs5BA (envelope-from ) for ; Mon, 17 May 2021 12:02:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OIRyHCE/omB3FgAA1q6Kng (envelope-from ) for ; Mon, 17 May 2021 10:02:09 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0F3151F5D1 for ; Mon, 17 May 2021 12:02:09 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 35BDC2A9C2; Mon, 17 May 2021 06:02:05 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id EF0242905F for ; Mon, 17 May 2021 06:02:02 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 6F6E860018; Mon, 17 May 2021 06:02:01 -0400 (EDT) Received: (nullmailer pid 3685538 invoked by uid 1000); Mon, 17 May 2021 10:02:00 -0000 From: David Bremner To: Michael J Gruber , notmuch@notmuchmail.org Subject: Re: [PATCH] test: add known broken test for duplicate thread-id terms In-Reply-To: <162124403391.5529.16910640491826871516.git@grubix.eu> References: <20210515130507.2629859-1-david@tethera.net> <162124403391.5529.16910640491826871516.git@grubix.eu> Date: Mon, 17 May 2021 07:02:00 -0300 Message-ID: <87eee5znjb.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: HVRFVLDN5UWZUP6ACTXDKUPXLMTMAPT2 X-Message-ID-Hash: HVRFVLDN5UWZUP6ACTXDKUPXLMTMAPT2 X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621245729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1mE/PllNN3pbaNsGegvcsyzEIYFqJ6t/5cV+KJg0F/w=; b=W1jQjNzDWPGVTozbfIYwRRZDoF9pBIPvDSAFukM4V/zRgGiSjMlJS6a26sTd+Q24yMFu3F gaabbD6yN1YyKU11RiSMoCrpbYNxvU2+egnMsCmf6RCNmiWTHvxD4vR6TMdPIIgyqinhcW oc1hgjEbXxrFZgQ95Bjrqxdv2wZQC9OV9J3zxza1hQwERVtgg2VdIsOuKEdErZH/E3T1kU a8pB+7fH4V0trMkBRo4t51iDrxgFKYCFbmNg54X1k4ScE0Cu0PrCi0W1gG5lBTptiU8pU6 ymVjbmjGcDtRJFVl7lWjX2v1Tsu7IDOJkSY1V84aSA22DEUshYotvBY+pabF3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621245729; a=rsa-sha256; cv=none; b=LwnNru0SZ9FrTIRsDSAKicDIi/VAtL44m+NKz6N8QEyxNbgy7oT2mDDiMjcNF8+2JK84Pn PvCgZDa5NPneffqjo1IGveOqqobpLRbuKrCyWK5VfaONr5/kfq8joDy70MM5Tq5ptrcaM6 0CdumWkRhJCm1ldn6WHs6YGM4t1DfUoBv+DJEwYD6KJcrhuH5JJquKlPx0dIeozm/wMa5g 8Ruvzyx4+p65O0wIQdE70h0YzmIBD+60Iwm482S4yq24yP9PqaSdeb7oiUXIVAW9uWsw5n Q6uMkp9C+Fnr2PIlU/UO929pVfgEs35nPZbQ/4U7cXm8Non1U9lQLXvixqgIVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.05 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 0F3151F5D1 X-Spam-Score: -2.05 X-Migadu-Scanner: scn0.migadu.com X-TUID: lc+YBbbqrBv4 Michael J Gruber writes: > David Bremner venit, vidit, dixit 2021-05-15 15:05:07: >> According to my bijection, this bug has been present since commit >> 411675a6ce in 2017. It is apparently harmless for regular use, but >> does make notmuch crash when compiled with -DDEBUG_DATABASE_SANITY. > > If a message "belongs" to 2 threads, doesn't it mean that it "belongs" > to at least 1 that it doesn't really belong to? Sure, conceptually a message should belong to only one thread. But it isn't clear what having an extra thread-id attached to a message really means. As far as I can tell, _notmuch_message_get_term will just always choose the lexicographically first (i.e. minimum) term. > The recent problem with "db update in pre-new hook" surfaced as extra > thread assignments for the wrong messages (making them show up the wrong > thread, too). To the best of my knowledge, this was caused by something else, namely the in-memory view of last thread-id being out of sync with the database. > I meanwhile noticed that they are more common, but am wondering whether > they are really harmless? It's possible that I missed some harmful effect. Anton reminded me on IRC of some previous issues with threading that could conceivably be related. I guess it would be more precise to say "Duplicate thread-id terms have not been demonstrated to cause problems in regular use". I mean, they're obviously a bug.