Open Bug 1925085 Opened 1 month ago Updated 24 days ago

Attempt to fix folder corruption bug 1890230 using backout of related changes on comm-esr128 since TB 122.

Categories

(Thunderbird :: General, task)

Thunderbird 128

Tracking

(Not tracked)

People

(Reporter: KaiE, Unassigned)

References

Details

(Whiteboard: [Version 128 only])

Attachments

(40 files, 2 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

This is an attempt to fix folder corruption bug 1890230 using backout of related changes since TB 122.

It's not yet clear if this approach will be taken, and whether it is safe to do.

The intention is to investigate/test this approach in parallel to the efforts in bug 1890230.

All attached patches are on top of comm-esr128.

Summary: Attempt to fix folder corruption bug 1890230 using backout of related changes since TB 122. → Attempt to fix folder corruption bug 1890230 using backout of related changes on comm-esr128 since TB 122.
Version: unspecified → Thunderbird 128
Whiteboard: [Version 128 only]

Attached are 33 backed out commits.
For the record, I'm counting 2211 commits on the comm-esr128 branch since bug 1719121 commit 222268ebb87b.

Attachment #9431349 - Attachment is obsolete: true
Attachment #9431348 - Attachment is obsolete: true

Removed 2 unnecessary backouts.

[Edited: This build is old. Please scroll down for a newer build.]

Below are links to experimental builds of 128.3.x, which revert the changes that were made to Thunderbird's Folder storage during the development of TB 128. (In particular, since bug 1719121).

If you are affected by bug 1890230, and are willing to test an alternative fix, you may try these builds. They will work with your regular profile, the one you're already using with Version 128.

Please be aware that this has some risk on its own. It's possible that there is an interdependency between other changes that were made to 128.x, which is broken by the changes in this experiment. So if you consider to try this, it might be good if you backup your Profile directory beforehand.

If you do test it, please give us feedback here:

  • Does this version prevent new corruption issues from happening?
  • Do you see any other functional side effects when using this build?

Thank you very much in advanced for testing and reporting back.

I suggest that you download, extract it to a separate place, and manually run it from the extracted directory.
This approach won't overwrite your installed version. However, it will require that every time you want to use this experimental version again, you must again run it manually from the extracted directory.

Download links:

Linux 64 bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Y8z_SNldSmi6YI8OM0B1Rg/runs/0/artifacts/public/build/target.tar.bz2

Windows 64 bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/RN--citoStC9Y4gJLUf1_g/runs/0/artifacts/public/build/target.zip

Windows 32 bit:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/ATzePuc_RqqDSGLFhi_kGA/runs/0/artifacts/public/build/target.zip

Mac OS:
https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/dC7AujHLQteC4Lk8ZTmLUA/runs/0/artifacts/public/build/target.dmg

(For technical users, here is the overall link to all details of this build:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=0a410752e0b6649baf261b71bd80a7c2d505a498 )

Using a 32 bit build, we should test that working with 5 GB mailboxes works correctly.

Based on new information, the backout strategy no longer seems viable to me (without extra work).

The old code, which this backout would restore, expects that we have meta information available that accurately records the sizes of messages, as it uses those sizes to determine how much data to read from the mbox files.

The latest storage code (as used in released 128.x) no longer assures that the meta information has the same accurate sizes as in the past, it stores different sizes.

As a result, when using mbox files that were created using 128.x, with a backout build from here, the code operates on truncated messages.

I can reproduce this. When receiving a message with 128.x, then switching to the backout build and using "save message", the resulting file is truncated.

Is this really true? That would mean an mbox file processed by 128 can't be used in 115 or earlier any more? Has that incompatibility been published?

Let's ask Ben, maybe I misunderstood something.

Flags: needinfo?(benc)

(But in general, we don't support downgrading to an earlier major release.)

Well, while that's true, there are many situations where people need to use the -allow-downgrade switch. Usually a new version makes some changes to the profile, we've seen cases where the security databases don't survive a downgrade, there have been irreversible address book upgrades (where in case of downgrade you had to manually restore backed up address book files), but that gigabytes of "standard" mbox data become invalid or at least need to have their indexes rebuilt, appears to be a new situation. As far as I know mbox/msf data so far has been downward compatible for the last 10 years, certainly back down to TB 38 or so.

(In reply to Kai Engert (:KaiE:) from comment #51)

Let's ask Ben, maybe I misunderstood something.

No, you're basically right.

In the old code, .messageSize was overloaded with three different meanings:

  1. for IMAP, it was the size of the message on the server
  2. for local folders it was the size of the message as encoded in the mbox file (for IMAP, this value was instead stored in .offlineMessageSize)
  3. it is the size of the non-mbox-encoded raw RFCx22 message (eg the size of the message as displayed in the gui)

1 and 3 are mostly the same meanings, except that local copies of messages usually have some extra headers added (X-Mozilla-Status/Status2/Keys), and so tend to be larger.

2 was the meaning that the code relied upon.
2 and 3 are subtlety different because mbox encoding adds the "From " separator line and also adds extra '>' characters in the message body to escape lines beginning with "From ".
This meant that every place that dealt with local copies of messages needed to implement it's own mbox encoding/decoding, and this was very inconsistent. It also made a lot of maildir (and potentially other storage backends) nigh-on impossible to implement properly.

So the aim of the new code was to decouple the mbox details from the rest of the codebase and keep all the mbox-specific encoding/decoding in one place (the mbox message store). So, given that the encoded length was definitely an mbox-specific detail, code outside the mbox shouldn't have to deal with it.

So I went with meaning 3 for .messageSize the raw RFCx22 size, which has the same value regardless of the storage backend.

I didn't anticipate that it would be an issue. All the storage backends (including mbox) must be capable of knowing when the end of a message has been encountered without having an explicit size passed in from outside, so meaning 3 seemed like the "correct" (and storage-agnostic) use of .messageSize.

The upshot being that .messageSize values written out by the newer code are likely to be a little less than the mbox-encoded-length of the message.

Flags: needinfo?(benc)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: