Skip to content

ui-server: journal scrub never reconciles quarantine files that have no row #4411

Open

Description

@schlessera

Part of #4278. Deferred from the tenth review of PR #4323 (#4290).

Context

  • createJournalScrub (packages/ui-server/src/brain/journal-scrub.ts:22-26) lists only the object-store root through journalDirectory(root), and takes its candidates from that listing (:79-83).
  • Nothing lists ${root}/quarantine. The quota charge for quarantined bytes comes only from turn_journal_scrub_quarantine rows (packages/ui-server/src/brain/journal-accounting.ts:91).
  • Restoring the database to a state older than a quarantine move, while keeping the object store, leaves the quarantined file with no row. Its bytes are uncharged, and full scrubs report complete with zero unaccounted bytes.
  • The ui-server: journal store files that have no database row are never collected #4290 ruling says quarantined bytes count toward the quota until removed.

Scope

Have the bounded scrub also account for hash-named files in the quarantine directory that no row names, within the existing per-run work bound. Out of scope: removing a quarantine, and changing snapshot contents.

Acceptance criteria

  • A test quarantines an orphan, restores a database image taken before the move and keeps the store. A later scrub charges the file's bytes again and reports it.
  • Until that file is accounted, the scrub does not report complete with zero unaccounted bytes.
  • The quarantine listing is bounded per run and resumes on the next run.
  • A quarantine file whose content does not hash to its name is reported separately and not removed.

Activity

  1. added
    type: fix
    area: ui-server
    priority: p3
    agent-ready
    on Nov 21, 2026
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

    agent-readyarea: ui-serverpriority: p3type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions