Repository navigation
feat(cleaning): Hold wipes that cannot clean a drive; add DisposeDrive - #207
Conversation
d2ec90b to
14089b4
Compare
f436202 to
5095e26
Compare
…eDrive A drive that stays missing or uncovered past a 10-minute grace now holds the server: admission admits the wipe and ends it OutcomeUnknown in the same custody update, so nothing is delivered. Staff settle the hold with a DeviceRecovery decision DisposeDrive, admitted only for a drive the held wipe could not clean and discovery no longer reports. It records the disposal with the Release holder, the planner omits the drive, and release continues; Retry is refused for this hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds off Retry After a DisposeDrive the Cleaning condition stayed False, so the next drive that could not be cleaned skipped its grace and held the server at once. Clear it when a disposal settles the hold, and run the grace on the allocator's clock. A drive hold that carries a retried wipe's lineage no longer takes the Retry branch. The simulator's wipe accepts any subset of its enrolled disks, as a plan has once drives are disposed of. Document the replaced installation hold and that attestation is the proof for a drive whose serial changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DisposeDrive compared the held wipe's object UID with the hold. It now requires the wipe to carry the status the coordinator gave it at the hold's fence, so a wipe recreated under the same name cannot authorize a disposal, and no check depends on an object UID. Pin test policies by generation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cord C matches operations only by name and admission fence, so a wipe's status no longer pins the held incarnation. When a wipe is held for drives it cannot clean, custody now records those drives with the hold, and DisposeDrive reads only that record. A wipe recreated under the held wipe's name cannot authorize a disposal, which the recreation test checks with a forged plan. Port test fixtures to the Device reference without a UID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The allocation tests' DeviceRecovery fixtures lacked the device-uid label C requires on operations, so custody refused the disposals and two tests timed out. Label them, test that DisposeDrive is refused under a hold rebuild formed, describe disposedDrive as reading custody's record, and add both guarantees to the recreation table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14089b4 to
11d0772
Compare
5095e26 to
37857ff
Compare
ecv
left a comment
There was a problem hiding this comment.
Request changes.
The disposed-drive hole is still open at f6bbfb4. A drive staff dispose of is dropped from every later plan by name, and nothing checks again that it is gone, so if discovery reports it once more, release can finish without wiping it and its data goes to the next tenant.
- I ran
cleaning.Planat this head with a two-drive manifest,disk-1disposed, and SN-B back in reported storage: the plan isdisk-0only, with no state and no error. With both pinned drives disposed and both reported, the plan is empty, whicherrNothingToCleanturns into a closedCleaninggate and no wipe.DisposedDriverecords the serial, butPlanand the later-drive loop skip by name and by pinned serial.DisposeDrivechecks the drive is absent only when it is recorded. ARemoveddisposal makes this likely, since a pulled drive can be re-seated. Fix: when discovery reports a disposed serial, plan itUncovered(or refuse the plan) so the hold re-forms, with aTestPlanrow and an allocation test. No test covers it. - The staging merge held: the
!drives &&guard,offersNetworkBoot(ErrNoWipeMethod/ErrDeliveryUnknown),BootNetworkandmatchExistingwithcreateOnceall survive inrelease.go, and the base is CLEAN. The allocation drive-hold, wipe and recovery tests pass at this head. - Guard with no test: removing the
!drives &&condition inclean(), which stops a retry lineage from skipping a drive hold, fails no allocation test (I ran the allocation tests with it removed).checkRecoveryalso refuses Retry for a drive hold, which I did not mutate.
Follow-ups:
Planreads the last discovery (up to twice the interval old) and nothing compares drives after a wipeSucceeded;WipedDisksis not checked against the plan and the Redfish worker returnsdisk-0unconditionally. Land the evidence check before any site cleans more than one drive.DestroyedandRemovedcarry only a free-text reference. Say who can create aDeviceRecoverywith DisposeDrive and audit it.WipeDeadlineis still a constant (40 minutes) rather than derived from the plan's drives and sizes.- The multi-plane acceptance box is still unchecked.
ecv
left a comment
There was a problem hiding this comment.
Approve.
The hold is resolved. Plan now marks a disposed drive Uncovered when discovery reports its serial again, so the drive hold re-forms instead of release finishing without a wipe, and the doc says so.
- Turning off the new branch fails
TestPlan("disposed serial returns: plan = [disk-0=SN-A:], want [disk-0=SN-A: disk-1=SN-B:Uncovered]"). The "all disposed serials return" row covers the case that used to close theCleaninggate with no wipe. TestReturnedDisposedDriveHoldsReleaseDespiteRetryLineagedrives it end to end in envtest, and removing the!drives &&condition inclean()now fails it ("retry lineage advanced held wipe"), so that guard is covered too.
Follow-ups from the earlier review still stand: no post-wipe drive check or WipedDisks evidence check, WipeDeadline is a constant, and who may record a DisposeDrive recovery should be stated and audited.
# Conflicts: # internal/allocation/harness_test.go
ecv
left a comment
There was a problem hiding this comment.
Approve.
The delta is a merge of the refreshed cleaning plan. The only hand resolution is in the allocation test harness; the disposed-serial branch in Plan, the !drives && guard and staging's offersNetworkBoot/matchExisting gates in release.go are intact.
Summary
A wipe could not clean a pinned drive that went missing or had no covering method, and the release had no way forward. Now, once such a drive stays that way for 10 minutes, release holds the server: the wipe is admitted and ended unknown in one custody update, so nothing reaches the site. Staff settle the hold with a new recovery decision, DisposeDrive, which records how the drive was destroyed or removed, and release continues without it.
DisposeDrive is accepted only under that hold, for a drive the held wipe could not clean and discovery no longer reports. Retry is refused for these holds, because a retried wipe would plan the same drive.
Decisions
Test plan
🤖 Generated with Claude Code