[PATCH v3 15/16] added notmuch_message_reindex
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed Feb 10 09:21:24 PST 2016
On Tue 2016-02-09 20:01:43 -0500, Daniel Kahn Gillmor wrote:
>> I just wanted to mention that I think there's a problem with the reindex
>> functionality introduced in this patch (or in 16/16). It looks like
>> this function irrevocably busts apart threads. dkg and I are
>> investigating.
>
> it doesn't appear to be irrevocable to me, but it is definitely doing
> something weird with threading.
OK, this is definitely tickling some problems with threading, but those
are problems that are present already in existing versions of notmuch,
unrelated to this series.
When removing a message from the database, its earlier presence doesn't
become a ghost message, and as a result anything that points to it
doesn't get assembled into the prior thread properly.
The attached tarball has a python test showing this behavior with a
simple thread of two messages:
0 dkg at frigg:~/src/notmuch/threading-test$ ./run-test
Found 2 total files (that's not much mail).
Processed 2 total files in almost no time.
Added 2 new messages to the database.
Threads: 1
removing and re-adding a at example.com
Threads: 2
removing and re-adding b at example.com
Threads: 1
0 dkg at frigg:~/src/notmuch/threading-test$
the relevant python function is:
def remove_and_readd(db, mid):
print('removing and re-adding', mid)
m = db.find_message(mid)
f = m.get_filename()
db.remove_message(f)
db.add_message(f)
I think when a message is removed from the database, we need to know
whether anything else (in its same thread?) refers to it. If so, we
should keep it around as a ghost message instead of fully removing it.
does this sound like the right approach?
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: threading-test.tgz
Type: application/x-gtar-compressed
Size: 838 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20160210/31f22d24/attachment.tgz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 948 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20160210/31f22d24/attachment.sig>
More information about the notmuch
mailing list