Skip to content

feat(kv): add KvPurge for byte-reclaiming key purge (NATS rollup)#11

Merged
jaredLunde merged 1 commit into
mainfrom
add-kvpurge
Jun 15, 2026
Merged

feat(kv): add KvPurge for byte-reclaiming key purge (NATS rollup)#11
jaredLunde merged 1 commit into
mainfrom
add-kvpurge

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Additive KvPurge: KvWriter trait; NATS impl issues a rollup purge
(Nats-Rollup: sub) that drops all prior revisions of a subject and reclaims
bytes — unlike delete/delete_with_version which only append markers.

  • Vended via KvStore::purge_writer() (default None, like KvTtl) + advertised
    via ConnectionCapabilities::purge; other backends/consumers unaffected.
  • purge_reclaims_bytes test (real nats-server) proves fill→purge drops stream bytes.
  • Patch bump 0.7.0 → 0.7.1 (additive, semver-compatible).

Needed by orchestrator dead-tombstone GC for orch-service-generation.

🤖 Generated with Claude Code

delete() and delete_with_version() only append markers — on a bucket with
no max_age their bytes accumulate against max_bytes forever. Add an additive
KvPurge: KvWriter trait whose NATS impl issues a rollup purge (Nats-Rollup:
sub) that drops all prior revisions of a subject and reclaims the bytes.

Vended via KvStore::purge_writer() (default None, like the existing KvTtl
split) so other backends and consumers are unaffected; advertised via
ConnectionCapabilities::purge. Real-nats-server test proves a fill→purge
round-trip strictly drops the stream's byte count.

Patch-bump 0.7.0 -> 0.7.1 (additive, semver-compatible).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jaredLunde jaredLunde merged commit f3bc20d into main Jun 15, 2026
1 check passed
@jaredLunde jaredLunde deleted the add-kvpurge branch June 15, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant