From: Austin Clements Date: Fri, 3 Oct 2014 14:19:18 +0000 (+2000) Subject: [PATCH 11/11] lib: Remove unnecessary thread linking steps when using ghost messages X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cecf0e4ee29a8f85412ec2bd4a7d6bb58150a094;p=notmuch-archives.git [PATCH 11/11] lib: Remove unnecessary thread linking steps when using ghost messages --- diff --git a/41/8fbfb9e18ce3352049ed02168bb6a5c868a0a6 b/41/8fbfb9e18ce3352049ed02168bb6a5c868a0a6 new file mode 100644 index 000000000..96539db5d --- /dev/null +++ b/41/8fbfb9e18ce3352049ed02168bb6a5c868a0a6 @@ -0,0 +1,123 @@ +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 8E7EC431FDA + for ; Fri, 3 Oct 2014 07:19:32 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 FLQdPi1R40Kv for ; + Fri, 3 Oct 2014 07:19:25 -0700 (PDT) +Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu + [18.9.25.12]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8283E431FB6 + for ; Fri, 3 Oct 2014 07:19:25 -0700 (PDT) +X-AuditID: 1209190c-f795e6d000006c66-50-542eb06b2f55 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP + id 24.34.27750.B60BE245; Fri, 3 Oct 2014 10:19:23 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s93EJNat020196; + Fri, 3 Oct 2014 10:19:23 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s93EJLsa023326 + (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); + Fri, 3 Oct 2014 10:19:22 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.84) + (envelope-from ) + id 1Xa3hZ-0002KM-DJ; Fri, 03 Oct 2014 10:19:21 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 11/11] lib: Remove unnecessary thread linking steps when using + ghost messages +Date: Fri, 3 Oct 2014 10:19:18 -0400 +Message-Id: <1412345958-8278-12-git-send-email-aclements@csail.mit.edu> +X-Mailer: git-send-email 2.1.0 +In-Reply-To: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> +References: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nrpu9QS/EYOJ3M4vrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY83F36wFr3grpp7azdzA+Iari5GTQ0LARGLChvOsELaYxIV7 + 69m6GLk4hARmM0ls/LSEESQhJLCBUWLD6QoI+zaTxIfl4hBFSxglls16zQ6SYBPQl1ixdhLY + JBEBaYmdd2cD2RwczAJqEn+6VEDCwgKxEr83rwQrZxFQlXizvp8NxOYVcJe48/U2M8QRchIb + dv8H28sJFL9w9ykbxF43iVXHutkmMPIvYGRYxSibklulm5uYmVOcmqxbnJyYl5dapGuol5tZ + opeaUrqJERQynJI8OxjfHFQ6xCjAwajEw/vhhm6IEGtiWXFl7iFGSQ4mJVHeysV6IUJ8Sfkp + lRmJxRnxRaU5qcWHGCU4mJVEeBesBMrxpiRWVqUW5cOkpDlYlMR5N/3gCxESSE8sSc1OTS1I + LYLJynBwKEnwtq8HahQsSk1PrUjLzClBSDNxcIIM5wEaDlbDW1yQmFucmQ6RP8WoKCXO+3Ad + UEIAJJFRmgfXC4vpV4ziQK8I83aBtPMA0wFc9yugwUxAg9/Z64IMLklESEk1MGZ9ELrJtvJW + 4lOrjatPvfjCN4P1WfuPFf5L1B1Sp0T/3tAk6szRNfua2U/21xwrp01NKJF4eU0q2dg79tW7 + A28fvu7fEPp5Bv+6WX2/T5wqPqnW/oh9nlhd8wtFscXJm15EM7W1bbuq8+JASoHLxOP3lm5w + qD2xfuU+tb/F5acEir/LWzyddqtfiaU4I9FQi7moOBEAqHFuJ8QCAAA= +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: Fri, 03 Oct 2014 14:19:33 -0000 + +From: Austin Clements + +Previously, it was necessary to link new messages to children to work +around some (though not all) problems with the old metadata-based +approach to stored thread IDs. With ghost messages, this is no longer +necessary, so don't bother with child linking when ghost messages are +in use. +--- + lib/database.cc | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/lib/database.cc b/lib/database.cc +index ff6a7f6..4655f59 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -2167,10 +2167,23 @@ _notmuch_database_link_message (notmuch_database_t *notmuch, + if (status) + goto DONE; + +- status = _notmuch_database_link_message_to_children (notmuch, message, +- &thread_id); +- if (status) +- goto DONE; ++ if (! (notmuch->features & NOTMUCH_FEATURE_GHOSTS)) { ++ /* In general, it shouldn't be necessary to link children, ++ * since the earlier indexing of those children will have ++ * stored a thread ID for the missing parent. However, prior ++ * to ghost messages, these stored thread IDs were NOT ++ * rewritten during thread merging (and there was no ++ * performant way to do so), so if indexed children were ++ * pulled into a different thread ID by a merge, it was ++ * necessary to pull them *back* into the stored thread ID of ++ * the parent. With ghost messages, we just rewrite the ++ * stored thread IDs during merging, so this workaround isn't ++ * necessary. */ ++ status = _notmuch_database_link_message_to_children (notmuch, message, ++ &thread_id); ++ if (status) ++ goto DONE; ++ } + + /* If not part of any existing thread, generate a new thread ID. */ + if (thread_id == NULL) { +-- +2.1.0 +