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
tg db vacuum: check free disk before a full VACUUM #119
The storage benchmark (docs/storage.md, #80) shows that a full tg db vacuum (daemon stopped) needs free disk of about twice the cache file at its peak: the new copy plus the WAL, 3.37 GB for a 1.56 GB cache and 30.62 GB for a 15.55 GB one. Today a full disk is found only when SQLite fails (details.reason: disk_full), after minutes of work, and the VACUUM is rolled back.
Proposed: before a full VACUUM, compare the free space of the cache's file system with about twice the file size (plus a margin). When it is short, fail at once with GENERAL_ERROR, details.reason: disk_full, the bytes needed and free, and a suggestion: free some space, or start the daemon and run tg db vacuum again for the incremental mode where the cache has incremental auto_vacuum. tg status could show the same check next to its vacuum hint.
Done when e2e tests cover enough and too little free space (with an injected free-space reader), and docs/cli-commands.md describes it. Related: #80, #91.
Activity
feat(db): check free disk before a full vacuum