Skip to content

docs: an archive_delete caps the span at the last deadline in archived too - #532

Merged
CMGS merged 1 commit into
mainfrom
docs/fold-archive-delete-cap
Nov 9, 2026
Merged

CMGS merged 1 commit into
mainfrom
docs/fold-archive-delete-cap

Conversation

@CMGS

@CMGS CMGS commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The usage fold capped an archive_delete at min(t, the last deadline) only outside archived. Inside archived, the span ended at the purge's own t, so archived storage was billed past the retention deadline by:

  • the reaper's or sweep's tick;
  • the owner's downtime;
  • up to an hour for an orphan-row purge, the sweep that cluster.md calls "up to an hour late".

This PR applies the cap in every state. Inside archived, the last deadline is the retention deadline carried by the archive or adopt that entered the state, so every purge path now ends the archived span there.

Why this is a contract change rather than an event in the code:

  • The orphan-row purges (sweepOrphanArchives for a departed owner's row, and reconcileOwnRow for an unheld row) cannot tell their claim's fold state.
  • A claim whose node restarted with the registry down journals only its claim (TestReconcileWithTheRegistryDownRecordsOnlyTheEndNoOtherNodeCanHold), so it is still running when its row is purged.
  • Recording a reap with the row's deadline would end that compute span at the retention deadline instead of the lease's. review: 7 fixes, cuts, docs against the code #530 tried that and reverted it. review: 7 fixes, cuts, docs against the code #530 now pins the purge of that row to claim,archive_delete.
  • Capping archive_delete in every state bills both cases right with no new event. The local purge's reap-first order from review: 7 fixes, cuts, docs against the code #530 (4a0cb95) stays correct, but it is no longer needed for billing.

Consumers that fold the journal must apply the same cap in archived. A fold that already caps archive_delete at the last deadline in every state needs no change.

Docs only. No code or test change.

…d too

The fold rule capped archive_delete only outside archived, so inside it the archived-storage span ran to the purge's t: past the retention deadline by the sweep's tick, the owner's downtime, and up to the hour-late orphan sweep. Capping it at the last deadline in every state ends that span at the archive's retention deadline on every purge path, including the orphan-row purges, which can neither tell their claim's fold state nor record a reap without ending a still-running compute span at the retention deadline.
@CMGS
CMGS merged commit 707ef2c into main Nov 9, 2026
@CMGS
CMGS deleted the docs/fold-archive-delete-cap branch November 9, 2026 12:46
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