1 Return-Path: <aclements@csail.mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 1D044431FD4
\r
6 for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:31:40 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 1jXNvTE9oDqe for <notmuch@notmuchmail.org>;
\r
16 Thu, 23 Oct 2014 05:31:34 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (dmz-mailsec-scanner-8.mit.edu
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 162E5429E2E
\r
22 for <notmuch@notmuchmail.org>; Thu, 23 Oct 2014 05:31:01 -0700 (PDT)
\r
23 X-AuditID: 12074425-f79e46d000002583-b4-5448f5043af0
\r
24 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
25 (using TLS with cipher AES256-SHA (256/256 bits))
\r
26 (Client did not present a certificate)
\r
27 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
28 id E0.05.09603.405F8445; Thu, 23 Oct 2014 08:31:00 -0400 (EDT)
\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])
\r
30 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s9NCUtUc030515;
\r
31 Thu, 23 Oct 2014 08:30:56 -0400
\r
32 Received: from drake.dyndns.org
\r
33 (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
34 [216.15.114.40]) (authenticated bits=0)
\r
35 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
36 by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s9NCUsUX008990
\r
37 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);
\r
38 Thu, 23 Oct 2014 08:30:55 -0400
\r
39 Received: from amthrax by drake.dyndns.org with local (Exim 4.84)
\r
40 (envelope-from <aclements@csail.mit.edu>)
\r
41 id 1XhHXU-0007cG-Mp; Thu, 23 Oct 2014 08:30:48 -0400
\r
42 From: Austin Clements <aclements@csail.mit.edu>
\r
43 To: notmuch@notmuchmail.org
\r
44 Subject: [PATCH v3 9/9] lib: Remove unnecessary thread linking steps when
\r
45 using ghost messages
\r
46 Date: Thu, 23 Oct 2014 08:30:41 -0400
\r
47 Message-Id: <1414067441-29054-10-git-send-email-aclements@csail.mit.edu>
\r
48 X-Mailer: git-send-email 2.1.0
\r
49 In-Reply-To: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>
\r
50 References: <1414067441-29054-1-git-send-email-aclements@csail.mit.edu>
\r
51 X-Brightmail-Tracker:
\r
52 H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrsvy1SPEYGmnicXquTwW12/OZHZg
\r
53 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mq6tOMFasFC0ov9DK1sD40uBLkZODgkBE4m+
\r
54 P++YIGwxiQv31rN1MXJxCAnMZpL4taSLCcLZyCix+cxmFgjnDpPE9fVHGCGcJYwScy60s4P0
\r
55 swnoS6xYO4kVxBYRkJbYeXc2mM0s4Cjxef8iNhBbWCBO4uipQ2D1LAKqEp0Le8HivAIeEk+v
\r
56 H2WEuENOYsPu/2A2J1B8z447YDVCAu4S258fZJ3AyL+AkWEVo2xKbpVubmJmTnFqsm5xcmJe
\r
57 XmqRroVebmaJXmpK6SZGcCi5qO5gnHBI6RCjAAejEg/vhVSPECHWxLLiytxDjJIcTEqivDEP
\r
58 gEJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeOMvAOV4UxIrq1KL8mFS0hwsSuK8m37whQgJpCeW
\r
59 pGanphakFsFkZTg4lCR4Gb8ANQoWpaanVqRl5pQgpJk4OEGG8wANv/UZZHhxQWJucWY6RP4U
\r
60 o6KUOG8ySEIAJJFRmgfXC4v1V4ziQK8I86qBrOABpgm47ldAg5lArt4ANrgkESEl1cBopu+1
\r
61 XjCQ+3mi1gGJa59W1ScLnGmfvP0QX81z++aMRVfScx7r7T34/P0VtglKS3i/xYXxfZpRMrHC
\r
62 T+NteffTxV2ycRvYF8ydKSSUFeG0tvhCC8Ozmv5drHWF9zXdmg+sdNGW11kxk5ftuKulgedJ
\r
63 Hrkq1rKcSnvlsHzP27MSgw/1/fEsuKDEUpyRaKjFXFScCAC9dw+W0AIAAA==
\r
64 X-BeenThere: notmuch@notmuchmail.org
\r
65 X-Mailman-Version: 2.1.13
\r
67 List-Id: "Use and development of the notmuch mail system."
\r
68 <notmuch.notmuchmail.org>
\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
72 List-Post: <mailto:notmuch@notmuchmail.org>
\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
76 X-List-Received-Date: Thu, 23 Oct 2014 12:31:40 -0000
\r
78 From: Austin Clements <amdragon@mit.edu>
\r
80 Previously, it was necessary to link new messages to children to work
\r
81 around some (though not all) problems with the old metadata-based
\r
82 approach to stored thread IDs. With ghost messages, this is no longer
\r
83 necessary, so don't bother with child linking when ghost messages are
\r
86 lib/database.cc | 29 +++++++++++++++++++++--------
\r
87 1 file changed, 21 insertions(+), 8 deletions(-)
\r
89 diff --git a/lib/database.cc b/lib/database.cc
\r
90 index b673718..3601f9d 100644
\r
91 --- a/lib/database.cc
\r
92 +++ b/lib/database.cc
\r
93 @@ -2136,11 +2136,11 @@ _consume_metadata_thread_id (void *ctx, notmuch_database_t *notmuch,
\r
94 * reference 'message'.
\r
96 * In all cases, we assign to the current message the first thread ID
\r
97 - * found (through either parent or child). We will also merge any
\r
98 - * existing, distinct threads where this message belongs to both,
\r
99 - * (which is not uncommon when messages are processed out of order).
\r
100 + * found. We will also merge any existing, distinct threads where this
\r
101 + * message belongs to both, (which is not uncommon when messages are
\r
102 + * processed out of order).
\r
104 - * Finally, if no thread ID has been found through parent or child, we
\r
105 + * Finally, if no thread ID has been found through referenced messages, we
\r
106 * call _notmuch_message_generate_thread_id to generate a new thread
\r
107 * ID. This should only happen for new, top-level messages, (no
\r
108 * References or In-Reply-To header in this message, and no previously
\r
109 @@ -2172,10 +2172,23 @@ _notmuch_database_link_message (notmuch_database_t *notmuch,
\r
113 - status = _notmuch_database_link_message_to_children (notmuch, message,
\r
117 + if (! (notmuch->features & NOTMUCH_FEATURE_GHOSTS)) {
\r
118 + /* In general, it shouldn't be necessary to link children,
\r
119 + * since the earlier indexing of those children will have
\r
120 + * stored a thread ID for the missing parent. However, prior
\r
121 + * to ghost messages, these stored thread IDs were NOT
\r
122 + * rewritten during thread merging (and there was no
\r
123 + * performant way to do so), so if indexed children were
\r
124 + * pulled into a different thread ID by a merge, it was
\r
125 + * necessary to pull them *back* into the stored thread ID of
\r
126 + * the parent. With ghost messages, we just rewrite the
\r
127 + * stored thread IDs during merging, so this workaround isn't
\r
129 + status = _notmuch_database_link_message_to_children (notmuch, message,
\r
135 /* If not part of any existing thread, generate a new thread ID. */
\r
136 if (thread_id == NULL) {
\r