Skip to content

tg db vacuum: check free disk before a full VACUUM #119

Closed

Description

@neoromantic

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

  1. added
    enhancement
    on Oct 29, 2026
  2. added a commit that references this issue on Nov 17, 2026
    8cb99be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions