Repository navigation
pool: a checklist for a verb that replaces a claim's record or moves it to another pool - #675
Merged
Merged
Conversation
…it to another pool Resize is the first verb that publishes a new record for an existing id under another pool key. Every defect review found in it had one shape: a holder of the old record, a rule chosen by the pool key, or a check a claim passes once at admission, which the new verb was not walked against. Nothing in the code forces that walk, because the rules sit at their own entry points across the package. CHECKLIST.md lists those sites by function: who can still hold the old record (waiters on Transition, passes that copy pointers out of m.claimed, state keyed by the pointer), the fields a copy through the journal form drops, the rules chosen by Key or PolicyKey and whether each is read on every use or fixed on the record, the admission checks, the stores that must agree and their write order, and the usage events. The last column says how Resize handles each row, and the last section lists what Resize does not handle: thirteen accepted gaps with their reason, and two open ones (a volume change that waited for a resize answers 404; a claim that enters a replicating pool on a fenced node is not refused). No code changes.
…ange as handled The two open gaps of resize are fixed in their own change: fencedFor checks the pool the claim's policy follows, at the start and at the swap, and a volume change answers ErrReplaced for a replaced record. The volume row is also corrected: the change does not wait on the claim's lock for a hibernated claim, which answers ErrPaused first; it meets the swap during its volume lookup. The file lists fifteen accepted gaps, not thirteen as the first commit's message says.
foldTunBytes runs only from FlushClaims at shutdown, so no later fold repairs a count written to a replaced record. SetEgressLimit is a fourth caller of rewriteArchiveRow. resolveMoveIn does check its record. pendingCks is keyed by checkpoint id. archive can answer ErrReplaced, and archive and replicate upload a checkpoint before their second lock, which they delete when the record was replaced. The tun door writes its final count onto the record it holds. Hibernate, not the cold boot, ends the old connections. AdmitMove and readerSource also call tenantRemoved. Three accepted gaps stated their reason too strongly: Renew's window includes a tenant lookup on a cache miss; a pool removed during the call leaves the disk not grown; a row consumed through a stale record stays consumed until the hourly sweep or the next replica.
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.
What
One new file,
sandboxd/pool/CHECKLIST.md(170 lines). No code changes.It is a checklist for anyone who adds or changes a verb in package
poolthat publishes a new*types.Sandboxfor an existing id, changes a claim'sKeyorPolicySource, or moves a claim into another pool.Resizeis the one such verb today, and the last column of every table says how it handles that row.Why
Resizewas the first verb to replace a claim's record under another pool key. Every defect review found in it had the same shape: a holder of the old record, a rule chosen by the pool key, or a check a claim passes once at admission, that the new verb had not been walked against. The lease rule, the policy layer, the evacuation's pending list,unfence's list, the replica row's key, the inject check and the move waiter were all of this kind. Nothing in the code forces that walk: the rules sit at their own entry points across the package.What is in it
Transitionand what each answers after a swap; the passes that copy pointers out ofm.claimed, which of them write to the registry before they notice, and which conclude something global; the state keyed by the pointer.KeyorPolicyKey), and whether it is read on every use or fixed on the record at claim.It cites files and functions, never line numbers.
The two gaps it found
Reading the pool for this list found two rows resize did not handle. Both are fixed in #676, and the list records them as handled:
lease lostuntil the fence lifted.PUTorPATCHwhose volume lookup straddled a resize answered 404 for a claim that still exists.Merge order
Merge #676 first: the second commit here describes its two checks as present.
How it was checked
Five readers read
sandboxd/pool, the outbound files andtypesin full (not sampled) and listed every site in the seven categories with file and line. Every row of the checklist was then confirmed against the function it names. All 259 identifiers the file puts in backticks exist in the source.Note: the first commit's message says "thirteen accepted gaps"; the file has fifteen. The squash message should say fifteen.