Skip to content

feat(cleaning): Hold wipes that cannot clean a drive; add DisposeDrive - #207

Merged
scotwells merged 12 commits into
feat/manual-inventory-recordsfrom
feat/cleaning-dispose-drive
Nov 29, 2026
Merged

scotwells merged 12 commits into
feat/manual-inventory-recordsfrom
feat/cleaning-dispose-drive

Conversation

@scotwells

@scotwells scotwells commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Full CI validate job locally, with envtests confirmed to run
  • End to end with the real coordinator and simulator site: a drive is pulled, the server is held, staff dispose of the drive, and release finishes
  • Each blocked drive gets its own grace, and the hold, the Retry refusal, and the grace restart each fail their tests when removed
  • Multi-plane acceptance in local VM and Redfish modes

🤖 Generated with Claude Code

@scotwells
scotwells requested review from ecv and kevwilliams November 25, 2026 20:31
@scotwells scotwells changed the title feat(cleaning): Hold a wipe that cannot clean a drive, and add DisposeDrive feat(cleaning): Hold wipes that cannot clean a drive; add DisposeDrive Nov 25, 2026
@scotwells
scotwells force-pushed the feat/cleaning-dispose-drive branch from f436202 to 5095e26 Compare November 25, 2026 23:12
scotwells and others added 5 commits November 25, 2026 19:24
…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>
@scotwells

Copy link
Copy Markdown
Contributor Author

@ecv updated review head: 77230f73. It includes the corrected offline partition-marker assertion via #206; disposal and recovery behavior is unchanged.

@scotwells

Copy link
Copy Markdown
Contributor Author

@ecv please review updated head f6bbfb4a. It incorporates #206’s one-line registration fixture fix; no disposal behavior or assertions changed. The previously failing TestStageTwoEnablesRegisteredCapacity passed locally with -race on this head.

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Plan at this head with a two-drive manifest, disk-1 disposed, and SN-B back in reported storage: the plan is disk-0 only, with no state and no error. With both pinned drives disposed and both reported, the plan is empty, which errNothingToClean turns into a closed Cleaning gate and no wipe. DisposedDrive records the serial, but Plan and the later-drive loop skip by name and by pinned serial. DisposeDrive checks the drive is absent only when it is recorded. A Removed disposal makes this likely, since a pulled drive can be re-seated. Fix: when discovery reports a disposed serial, plan it Uncovered (or refuse the plan) so the hold re-forms, with a TestPlan row and an allocation test. No test covers it.
  • The staging merge held: the !drives && guard, offersNetworkBoot (ErrNoWipeMethod/ErrDeliveryUnknown), BootNetwork and matchExisting with createOnce all survive in release.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 in clean(), which stops a retry lineage from skipping a drive hold, fails no allocation test (I ran the allocation tests with it removed). checkRecovery also refuses Retry for a drive hold, which I did not mutate.

Follow-ups:

  • Plan reads the last discovery (up to twice the interval old) and nothing compares drives after a wipe Succeeded; WipedDisks is not checked against the plan and the Redfish worker returns disk-0 unconditionally. Land the evidence check before any site cleans more than one drive.
  • Destroyed and Removed carry only a free-text reference. Say who can create a DeviceRecovery with DisposeDrive and audit it.
  • WipeDeadline is still a constant (40 minutes) rather than derived from the plan's drives and sizes.
  • The multi-plane acceptance box is still unchecked.

@scotwells
scotwells requested a review from ecv November 29, 2026 21:03

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the Cleaning gate with no wipe.
  • TestReturnedDisposedDriveHoldsReleaseDespiteRetryLineage drives it end to end in envtest, and removing the !drives && condition in clean() 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
@scotwells
scotwells requested a review from ecv November 29, 2026 21:36

@ecv ecv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Base automatically changed from feat/cleaning-plan to feat/manual-inventory-records November 29, 2026 21:49
@scotwells
scotwells merged commit b9035f4 into feat/manual-inventory-records Nov 29, 2026
27 checks passed
@scotwells
scotwells deleted the feat/cleaning-dispose-drive branch November 29, 2026 21:50
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.

2 participants