You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background, resumable migrations for big caches #89
One-time migrations run in one BEGIN IMMEDIATE transaction on the first open of a cache. The last one (filling NULL senders) takes several seconds per 100,000 messages while it holds the write lock, and the daemon waits only 5 seconds for a write. Any change that rewrites every message (re-encoding raw_json byte fields, #86; filling attachment metadata from raw_json for #22; a search index rebuild with another tokenizer) would hold the lock for minutes on a cache with millions of messages.
Proposed:
A background migration runs in small batches, each its own short write, and records its progress in the cache, so it resumes after a stop and never holds the write lock for long.
The daemon runs pending ones; a command that needs one finished says so instead of waiting. tg status shows each pending migration and its progress.
Reads stay correct while a migration is half done (rows in the old and the new form both work).
Done when the re-encode of existing raw_json rows runs this way on a made-up cache, a stop in the middle resumes, a daemon write never waits more than a short batch, and docs/database-schema.md describes the mechanism. Related: #80.
Activity
docs: media cache limits, history has_media and wording fixes
feat(db): background, resumable migrations; re-encode raw_json, backf…
fix(db): re-encode only real Long and byte objects; recompute every m…
fix(db): re-encode only real Long and byte objects; recompute every m…