Closed Bug 1898780 Opened 4 months ago Closed 4 months ago

gloda.index_msg: Observed header that claims to be gloda indexed but that gloda has never heard of during compaction

Categories

(MailNews Core :: Backend, defect)

Thunderbird 128
defect

Tracking

(thunderbird_esr115 wontfix, thunderbird127 fixed)

RESOLVED FIXED
128 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird127 --- fixed

People

(Reporter: wsmwk, Assigned: benc)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Did not pay attention prior to the compact patch, but this may be happening more? On my first compact operation I see a couple hundred of these. Happens on every account

gloda.index_msg: Observed header that claims to be gloda indexed but that gloda has never heard of during compaction. In folder: imap://xxxx%40fastmail.com@imap.fastmail.com/INBOX sketchy key: 85929 subject: yyyyyyy ? IndexMsg.sys.mjs:1333:21

Flags: needinfo?(benc)

Wayne, I think that might be a case of the gloda post-compaction handling not correctly deleting compacted messages.
Do the warning you see all seem to correspond to deleted (compacted) messages?

It looks to me like the gloda post-compaction is mixing up false and null, so messages which are supposed to be deleted are instead falling through to the it's-all-gone-pearshaped case.

Geoff:
Quick JS question. Does it look like this is getting false and null mixed up?:
https://searchfox.org/comm-central/source/mailnews/db/gloda/modules/IndexMsg.sys.mjs#1302

false == null evaluates false, right?

If so, easy to fix. I suspect that warning has been showing up forever, but we're just more attuned to compaction-related stuff right now :-)

In other news: Oh boy.... looks like the gloda post-compaction pass dates back to the time when message keys were the file offset into the mbox!
Probably doesn't have any harmful effects but I'll file another bug to investigate.

Flags: needinfo?(geoff)

Do the warning you see all seem to correspond to deleted (compacted) messages?

yes

Regressed by: 1890448
Keywords: regression

That's right, false is not equal to null, did they mean !idBasedHeader?

Flags: needinfo?(geoff)
See Also: → 1899236
Assignee: nobody → benc
Status: NEW → ASSIGNED

(In reply to Geoff Lankow (:darktrojan) from comment #3)

That's right, false is not equal to null, did they mean !idBasedHeader?

No, I think idBasedHeader is a msgHdr, so if it's missing null seems more appropriate than false.
Easy fix.

Annoyingly though, I haven't yet been able to trigger the problem. I think I'd need to actually go through and understand gloda properly and try to figure out what's happening. Or maybe I'm just missing something. One day...

In any case, I think this was a legit bug, so I'm submitting a fix.

I just added another bug -Bug 1899236 - to investigate the possible gloda mbox-offset-as-msgkey issue.

Flags: needinfo?(benc)
See Also: → 1760447

I don't think it was a regression. The old folder compaction must have used this same code path too...

Pushed by solange@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/aeed85afc8eb
Make sure gloda removes compacted messages. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch

Anomalies when testing File > Compact with 20240529 daily build:

  • fastmail account - "Done compacting (approx 0 KB saved)." when there should have been messages compacted
  • personal gmail - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.
  • thunderbird.net account - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.
  • Blogs and News Feeds - "Done compacting (approx 0 KB saved)." when there should have been messages compacted

In all cases nothing in error console

Severity: -- → S3
Flags: needinfo?(vseerror)
Flags: needinfo?(vseerror) → needinfo?(benc)

Haven't yet been able to replicate these (for some reason I don't see the gmail login page, and my fastmail account has sooooo many emails it's taking an age to sync. I'm running the debug build which probably doesn't help)

In the meantime:

You can turn on logging with export MOZ_LOG="compact:5".
Might give some clues.

(In reply to Wayne Mery (:wsmwk) from comment #8)

Anomalies when testing File > Compact with 20240529 daily build:

  • fastmail account - "Done compacting (approx 0 KB saved)." when there should have been messages compacted
  • Blogs and News Feeds - "Done compacting (approx 0 KB saved)." when there should have been messages compacted

One thing I did notice: "File -> Compact Folders" seems to run "compact all", but only on the currently-active account.
So that might account for some of the "Done compacting (approx 0 KB saved)." messages.
Perhaps it wasn't compacting the folders you thought it was?

Can you actually delete messages from RSS folders?
I don't think you can with News folders.
The new code tries to be pretty folder-type-agnostic, so I'm not totally sure what the old behaviour was on these!

  • personal gmail - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.
  • thunderbird.net account - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.

Hmm. It'll be interesting to see if anything shows up in the compact MOZ_LOG about this...
I suspect it might be just a timing thing, with the local compaction and server-side EXPUNGE racing a little and not quite clearing up the status message... but I'll check as soon as I can get a gmail profile to log in.

(In reply to Ben Campbell from comment #9)

Haven't yet been able to replicate these (for some reason I don't see the gmail login page, and my fastmail account has sooooo many emails it's taking an age to sync. I'm running the debug build which probably doesn't help)

In the meantime:

You can turn on logging with export MOZ_LOG="compact:5".
Might give some clues.

(In reply to Wayne Mery (:wsmwk) from comment #8)

Anomalies when testing File > Compact with 20240529 daily build:

  • fastmail account - "Done compacting (approx 0 KB saved)." when there should have been messages compacted
  • Blogs and News Feeds - "Done compacting (approx 0 KB saved)." when there should have been messages compacted

One thing I did notice: "File -> Compact Folders" seems to run "compact all", but only on the currently-active account.
So that might account for some of the "Done compacting (approx 0 KB saved)." messages.
Perhaps it wasn't compacting the folders you thought it was?

Can you actually delete messages from RSS folders?

Yes, there is a Trash folder in the "Blog & News`Feeds" i.e. RSS account.

I don't think you can with News folders.

News account = nntp - correct, you cannot delete. That's different from RSS.

The new code tries to be pretty folder-type-agnostic, so I'm not totally sure what the old behaviour was on these!

  • personal gmail - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.
  • thunderbird.net account - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.

Hmm. It'll be interesting to see if anything shows up in the compact MOZ_LOG about this...
I suspect it might be just a timing thing, with the local compaction and server-side EXPUNGE racing a little and not quite clearing up the status message... but I'll check as soon as I can get a gmail profile to log in.

I was not able to reproduce the fails above using those steps.

But interesting results when I selected an account in folder pane and picked Compact I saw something much closer to what is normal, which is status bar shows compact going through all the folder names, followed by "xxx saved"

Compact context menu should operate only on one folder. Compact Folders from File menu would operate on all folders of a single account iirc.

  • personal gmail - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.
  • thunderbird.net account - "<account> Compacting folder ..." never clears from the status bar ... until I switch folders.

Hmm. It'll be interesting to see if anything shows up in the compact MOZ_LOG about this...
I suspect it might be just a timing thing, with the local compaction and server-side EXPUNGE racing a little and not quite clearing up the status message... but I'll check as soon as I can get a gmail profile to log in.

I was not able to reproduce the fails above using those steps.

But interesting results when I selected an account in folder pane and picked Compact I saw something much closer to what is normal, which is status bar shows compact going through all the folder names, followed by "xxx saved"

I noticed this issue for months, so long before this bug landed. So IMO it's not related.
With Tb daily 128.0a1 build 20240529104745 I can't reproduce this issue anymore.

Comment on attachment 9404236 [details]
Bug 1898780 - Make sure gloda removes compacted messages. r=#thunderbird-reviewers

[Approval Request Comment]
Approved for beta

Attachment #9404236 - Flags: approval-comm-beta+
Flags: needinfo?(benc)
Version: unspecified → Thunderbird 128
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: