Skip to content

Align notebook-docs retention with blob grace window #1818

@rgbkrk

Description

@rgbkrk

Operational knob: persisted notebook-docs (notebook-docs/{hash}.automerge + snapshots) and the blob store currently have independent retention/grace windows. A blob can be GC'd while its referencing doc is still persisted, surfacing as a dead-link output when the doc is reloaded.

Current state

  • Blob GC: grace window in daemon (likely 24h, check blob_store / daemon.rs)
  • notebook-docs: kept until explicit eviction or long idle
  • recover_notebook_docs reads the .automerge file; if blob hashes referenced inside aren't on disk anymore, outputs render as "missing blob"

Fix

Either:

  1. Align grace windows — notebook-doc eviction ≤ blob GC window. Simple.
  2. Reference-count on GC — sweep persisted docs for blob refs before evicting blobs (already partially done for active rooms via blob GC correctness spec Fix deprecation, dead code warnings, and other clippiness #1 — extend to persisted-but-evicted).
  3. Transitively promote blobs referenced by saved docs — when persisting a doc, also mark its blobs as "saved" in a separate tier with longer retention.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions