From: Austin Clements <aclements@csail.mit.edu>
To: Mark Walters <markwalters1009@gmail.com>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH v2 12/12] lib: Remove unnecessary thread linking steps when using ghost messages
Date: Tue, 21 Oct 2014 21:51:01 -0400 [thread overview]
Message-ID: <20141022015101.GF7970@csail.mit.edu> (raw)
In-Reply-To: <87wq7thv27.fsf@qmul.ac.uk>
Quoth Mark Walters on Oct 22 at 12:17 am:
> On Tue, 07 Oct 2014, Austin Clements <aclements@csail.mit.edu> wrote:
> > From: Austin Clements <amdragon@mit.edu>
> >
> > 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 1316529..6e51a72 100644
> > --- a/lib/database.cc
> > +++ b/lib/database.cc
> > @@ -2169,10 +2169,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;
> > + }
>
> Ok so this basically answers my earlier comment. It might be worth
> updating the big comment at the start of the function to match the new
> code though.
Like so?
diff --git a/lib/database.cc b/lib/database.cc
index d063ec8..3601f9d 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -2136,11 +2136,11 @@ _consume_metadata_thread_id (void *ctx, notmuch_database_t *notmuch,
* reference 'message'.
*
* In all cases, we assign to the current message the first thread ID
- * found (through either parent or child). We will also merge any
- * existing, distinct threads where this message belongs to both,
- * (which is not uncommon when messages are processed out of order).
+ * found. We will also merge any existing, distinct threads where this
+ * message belongs to both, (which is not uncommon when messages are
+ * processed out of order).
*
- * Finally, if no thread ID has been found through parent or child, we
+ * Finally, if no thread ID has been found through referenced messages, we
* call _notmuch_message_generate_thread_id to generate a new thread
* ID. This should only happen for new, top-level messages, (no
* References or In-Reply-To header in this message, and no previously
> Best wishes
>
> Mark
>
> >
> > /* If not part of any existing thread, generate a new thread ID. */
> > if (thread_id == NULL) {
> >
> > _______________________________________________
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2014-10-22 1:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 23:17 [PATCH 00/12] Add ghost messages and fix thread linking Austin Clements
2014-10-06 23:17 ` [PATCH v2 01/12] lib: Move message ID compression to _notmuch_message_create_for_message_id Austin Clements
2014-10-06 23:17 ` [PATCH v2 02/12] lib: Refactor _notmuch_database_link_message Austin Clements
2014-10-06 23:17 ` [PATCH v2 03/12] lib: Handle empty date value Austin Clements
2014-10-11 5:12 ` David Bremner
2014-10-06 23:17 ` [PATCH v2 04/12] lib: Add a ghost messages database feature Austin Clements
2014-10-06 23:17 ` [PATCH v2 05/12] lib: Update database schema doc for ghost messages Austin Clements
2014-10-06 23:17 ` [PATCH v2 06/12] lib: Introduce macros for bit operations Austin Clements
2014-10-06 23:17 ` [PATCH v2 07/12] lib: Internal support for querying and creating ghost messages Austin Clements
2014-10-21 23:05 ` Mark Walters
2014-10-22 1:33 ` Austin Clements
2014-10-06 23:17 ` [PATCH v2 08/12] lib: Implement ghost-based thread linking Austin Clements
2014-10-21 23:10 ` Mark Walters
2014-10-22 1:49 ` Austin Clements
2014-10-06 23:17 ` [PATCH v2 09/12] lib: Implement upgrade to ghost messages feature Austin Clements
2014-10-06 23:17 ` [PATCH v2 10/12] lib: Enable " Austin Clements
2014-10-06 23:17 ` [PATCH v2 11/12] test: Test upgrade to " Austin Clements
2014-10-06 23:17 ` [PATCH v2 12/12] lib: Remove unnecessary thread linking steps when using ghost messages Austin Clements
2014-10-21 23:17 ` Mark Walters
2014-10-22 1:51 ` Austin Clements [this message]
2014-10-21 23:32 ` [PATCH 00/12] Add ghost messages and fix thread linking Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141022015101.GF7970@csail.mit.edu \
--to=aclements@csail.mit.edu \
--cc=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).