Skip to content

Implement tombstone-aware KV blob garbage collection and quota reclamation #130

Description

@samgbafa

Current behavior

KV deletion is logical: the latest tombstone removes a key from GET/LIST immediately, but historical content-addressed blobs remain retained and continue counting toward the space quota. Physical deletion is unsafe because blobs can be shared by multiple keys or historical versions.

Required design

  • Reclaim a blob only after transactionally proving that no live or retained KV version references it.
  • Define whether quota tracks retained physical bytes or only live logical values, and make accounting consistent with that definition.
  • Keep deletion, conditional mutation, and GC safe under concurrent writers and multiple node replicas.
  • Make GC resumable and idempotent after process or transaction failure.
  • Expose enough metrics/logging to diagnose retained bytes and reclamation.

Acceptance criteria

  • Deleting a unique value eventually reclaims its eligible blob bytes and quota.
  • Deleting one of two keys that share identical content does not remove the surviving value.
  • Replacing and deleting keys concurrently with GC cannot resurrect data or delete live data.
  • Tests cover shared blobs, version history, tombstones, concurrent writers, interrupted GC, and quota behavior.
  • Public KV/MCP documentation is updated when reclamation semantics ship.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions