Open Bug 1899236 Opened 6 months ago Updated 4 months ago

Fix up possible gloda mbox assumptions in IndexMsg.sys.mjs

Categories

(MailNews Core :: Search, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

References

Details

Gloda IndexMsg.sys.mjs has a worrying reference to message keys being offsets into mbox files, which hasn't been the case for a decade or so...
I don't know that it'll cause any problems, but worth checking up on.

The comment in question:
https://searchfox.org/comm-central/source/mailnews/db/gloda/modules/IndexMsg.sys.mjs#1101

/**
   * Special indexing pass for (local) folders than have been compacted.  The
   *  compaction can cause message keys to change because message keys in local
   *  folders are simply offsets into the mbox file.  Accordingly, we need to
   *  update the gloda records/objects to point them at the new message key.
   *
   * Our general algorithm is to perform two traversals in parallel.  The first
   *  is a straightforward enumeration of the message headers in the folder that
   *  apparently have been already indexed.  These provide us with the message
   *  key and the "gloda-id" property.
   * The second is a list of tuples containing a gloda message id, its current
   *  message key per the gloda database, and the message-id header.  We re-fill
   *  the list with batches on-demand.  This allows us to both avoid dispatching
   *  needless UPDATEs as well as deal with messages that were tracked by the
   *  PendingCommitTracker but were discarded by the compaction notification.
   *
   * We end up processing two streams of gloda-id's and some extra info.  In
   *  the normal case we expect these two streams to line up exactly and all
   *  we need to do is update the message key if it has changed.

At the very least, the comment should be updated!

Summary: Fix up possible gloda mbox assupmptions → Fix up possible gloda mbox assumptions in IndexMsg.sys.mjs
Version: unspecified → Thunderbird 128
Version: Thunderbird 128 → Thunderbird 91
You need to log in before you can comment on or make changes to this bug.