Commit Graph
15 Commits
Author SHA1 Message Date
rustmailer c736afffb0 fix: account deletion times out #291 2026-06-07 15:34:38 +08:00
rustmailerandGitHub 327a3f39d9 Merge pull request #287 from fama/dedup-cache-fix
fix: open NewIndexWriter once across all migration segments
2026-06-04 10:24:22 +08:00
fama 427f7248d2 fix: open NewIndexWriter once across all migration segments
Previously, do_migrate_segment created a fresh NewIndexWriter (and
therefore a new Fjall Database) on every call, meaning the Fjall
database at bichon-storage/ was opened and closed once per segment.

This caused the migration to fail mid-way through (observed at segment
9/16) with:

  Storage(InvalidTag(("ChecksumType", 171)))

Root cause: after segment N writes email blobs via Fjall's ingestion
API (start_ingestion / write / finish), those SSTables and KV-separated
blob files are flushed to disk and the Database is dropped. When segment
N+1 calls Database::builder(storage_dir).open(), Fjall must discover and
catalog all on-disk files produced by the previous segments. During that
discovery it reads SSTable or blob-file block headers and encounters a
ChecksumType discriminant byte (171 / 0xAB) that lsm-tree 3.1.4 does
not recognise, causing the fatal error.

The first N segments succeed because the cumulative set of ingested
SSTables stays small enough that Fjall does not need to read the
offending headers during reopen. Once enough data has accumulated the
reopen triggers a manifest or compaction read that exposes the mismatch.

Fix: open NewIndexWriter once, before the segment loop, and pass a
&mut reference into each do_migrate_segment call. finish_writers() is
called a single time after all segments complete. The Fjall Database
stays open for the entire migration and is never closed and reopened,
eliminating the incompatible-reopen path entirely.
2026-06-03 15:10:03 -06:00
rustmailer a2a51a2037 feat(imap): add message size check before download 2026-06-03 21:17:35 +08:00
rustmailer 048d5f361c fix: Cant migrate with version >= 1.4.0 #277 2026-05-28 22:49:24 +08:00
rustmailer f30cd66e00 feat: remove folder limit 2026-05-26 15:22:14 +08:00
rustmailer 4bd714a670 chore: remove custom global allocator 2026-05-26 15:20:59 +08:00
rustmailer 005b1c2116 feat: added Cron scheduling for email downloads #211 2026-05-23 15:40:46 +08:00
rustmailer 0dd81f599d update 2026-05-22 22:21:46 +08:00
rustmailer 7fde7ee19a update 2026-05-17 10:35:32 +08:00
rustmailer b2a75643da fix(bichon-admin): reduce memory usage during data migration 2026-05-16 22:17:03 +08:00
rustmailer e708dc524b Update reset.rs 2026-05-15 01:17:40 +08:00
rustmailer 5406c4322c refactor: replace native_db with memdb and add tests 2026-05-14 02:29:23 +08:00
rustmailer 0abaa66a40 feat(admin): add interactive data migration tool 2026-05-12 01:56:24 +08:00
rustmailer 0b866c81ff refactor(workspace): decompose project into multiple crates 2026-04-23 21:45:34 +08:00