docs: proposal — allocation capacity gating, expiry, and finalization - #47
Open
frrist wants to merge 1 commit into
Open
docs: proposal — allocation capacity gating, expiry, and finalization#47frrist wants to merge 1 commit into
frrist wants to merge 1 commit into
Conversation
Design proposal covering: - capacity-aware blob/allocate (per-backend monitors for flatfs/MinIO, configurable occupancy threshold, named receipt failure) - real allocation expiry (configurable TTL enforced at allocate, upload, and accept) with a periodic janitor - finalizing allocations at blob/accept (AcceptedAt field) so cleanup is a single-store decision Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Design proposal for two gaps in the blob allocate/accept flow, plus the lifecycle model that ties them together.
Document:
docs/proposals/allocation-capacity-and-expiry.md.blob/allocateabove a configurable occupancy threshold, with per-backend monitors (statfs for flatfs, declared capacity + periodic bucket scan for MinIO/S3) and pending-byte accounting frompdp_piece_uploads.Expiresis hardcoded to 24h and nothing reads it.blob/acceptstamps the allocation record (AcceptedAt), making it the durable per-space storage ledger; the janitor then deletes pending+expired records on a single-store rule.Includes a race analysis versus the acceptance-aware-janitor alternative and why the latter was rejected.
Why these two features travel together
They are the two halves of making "an allocation reserves space" true, and the dependency runs one direction: capacity gating is incorrect without expiry, while expiry stands alone.
For the capacity gate to work for a reservation system it must count outstanding reservations (
Used + Pending + size > threshold × Total), otherwise a burst of allocations all pass the check against the same free space and collectively overshoot it.But once reservations count against capacity, they must be able to die: every abandoned upload otherwise parks its
check_sizeinpdp_piece_uploadsforever,Pendinggrows monotonically, and the node ends up denying all allocations while sitting on an empty disk.That is the guaranteed steady state, not a tail risk — clients abandon uploads routinely.
This is the standard admission-control + lease pattern: an admission test over a finite resource requires grants that expire, or the resource leaks.
The reverse motivation is weaker: expiry alone is correct but only cleans up cheap metadata and closes the
content/retrieveauthorization hole for never-fulfilled allocations.The asymmetry is why the phasing puts expiry first (phase 1) and capacity gating on top of it (phase 2).
No wire/libforge schema changes; coordination points for the upload service are called out in the doc (§9).
Review focus
🤖 Generated with Claude Code