Skip to content

fix(custody): Wait out IPAM outages and report full boot pools - #216

Merged
scotwells merged 3 commits into
feat/manual-inventory-recordsfrom
feat/ipam-claim-contract
Nov 29, 2026
Merged

scotwells merged 3 commits into
feat/manual-inventory-recordsfrom
feat/ipam-claim-contract

Conversation

@scotwells

@scotwells scotwells commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Boot address claims now follow the contract IPAM implements. A full pool or a refused claim is reported with IPAM's reason and creates no operation, and a release counts only once the claim is gone and IPAM no longer holds its address. When IPAM can't be read at admission, an installation or wipe waits and is checked again instead of failing. Stacked on #197, and must land before #218; #198 is a sibling with no overlap.

Related to #186

How it stays inactive

It changes only operations that carry a boot address, and nothing gives them one: no binary or configuration sets a boot address class. The new permission, reading IPAM's allocations to confirm a release, goes into the opt-in boot address requester role, which no overlay includes.

Decisions for a person

  • IPAM has no per-operation claim lifetime and no field naming a physical server, so Fleet keeps both in labels and deletes claims itself. Whether to ask IPAM for either is open.
  • An allocation that outlives its claim, for example after a claim stored with a retaining policy, keeps a release unverified until a person removes it. Nothing surfaces it beyond the release error.
  • Any IPAM read error except a missing claim keeps an operation waiting, with the error in its message; a missing grant waits the same way as an outage.

Test plan

  • Unit tests for the create race, exhaustion, refusals, retaining claims and outages
  • A release stays unverified after a failed delete, a lost response, a delete that leaves the claim, and a deleted claim whose allocation remains
  • A full pool creates no installation, and an IPAM outage at admission leaves the operation waiting and rechecked
  • Every gh pr checks entry green on the head, including the multi-plane acceptance

🤖 Generated with Claude Code

@scotwells
scotwells requested review from ecv and kevwilliams November 26, 2026 00:52
@scotwells scotwells changed the title fix: Follow IPAM's claim contract for boot addresses fix: Follow IPAM's claim contract for boot claims Nov 26, 2026
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from e7c530d to c72a856 Compare November 26, 2026 01:15
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from ba109e0 to 20cbcec Compare November 26, 2026 03:43
@scotwells
scotwells changed the base branch from feat/machine-network-attachment to feat/boot-network-site-dhcp November 26, 2026 03:43
@scotwells
scotwells force-pushed the feat/boot-network-site-dhcp branch from 6bc39b4 to ff91454 Compare November 28, 2026 23:14
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from 20cbcec to b355e66 Compare November 28, 2026 23:23
@scotwells
scotwells force-pushed the feat/boot-network-site-dhcp branch from ff91454 to f417f2d Compare November 29, 2026 01:20
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from b355e66 to 6b2de4a Compare November 29, 2026 01:20
@scotwells
scotwells force-pushed the feat/boot-network-site-dhcp branch from f417f2d to ce8b479 Compare November 29, 2026 02:03
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from 6b2de4a to ef820d6 Compare November 29, 2026 02:04
@scotwells scotwells changed the title fix: Follow IPAM's claim contract for boot claims fix(custody): Wait out IPAM outages and report full boot pools Nov 29, 2026
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from ef820d6 to 33156b9 Compare November 29, 2026 02:15
@scotwells scotwells added the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 29, 2026
@scotwells
scotwells marked this pull request as ready for review November 29, 2026 02:59
@scotwells
scotwells requested a review from a team as a code owner November 29, 2026 02:59

@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.

An IPAM outage now keeps an operation Pending and re-checked instead of admitting or failing it, and a full pool or refused claim surfaces IPAM's reason with no operation created. Inert today: no config sets a boot address class and the new IPAM read grant sits in the opt-in requester role no overlay includes. I mutated the claim-retention guard (deletes) and the verified-release check (unallocated forced true) in internal/bootaddress, and each failed its test (TestARetainingClaimIsNeverUsed, TestReleaseIsVerifiedAndAnUnknownOutcomeKeepsTheAddressHeld). Disabling the Retry branch in coordinator.go also failed TestAdmissionPreconditions (no requeue on an undecided check).

  • The outage wait is unbounded and fixed at 5s (undecidedRetry, coordinator.go): only staff operations expire, so a customer-path operation waits forever, and a missing ipallocations/ipclaims grant looks the same as an outage and re-checks every 5s per operation. Cap it or back off, and surface a long wait (the PR already lists this as a decision, so not a hold).
  • Release lists every IPAllocation in the namespace per call to find one claim. Fine at lab scale; select by claim name when the pool is real.
  • Release deletes with no UID precondition (IPAM ignores them), so the name plus the operation and kind labels is the only guard against deleting another claim. Release does not check the allocation label while Claim does; check it too.

Follow-ups:

  • An allocation that outlives its claim stays unverified until a person removes it, with nothing but the release error to say so. Add an alert or condition before this is selected anywhere.
  • Fleet-side claim lifetime and physical-server labels are left open; decide before the first real site.

@scotwells
scotwells requested a review from ecv November 29, 2026 04:32

@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.

Still approved at 33156b9: nothing has changed since my last review.

scotwells and others added 3 commits November 29, 2026 00:45
IPAM reports a racing create of the same claim as a 409 Conflict with a
ClaimExists cause, so the requester now reads the existing claim instead
of failing. A full pool (507, Exhausted) is reported as ErrExhausted and
other refusals (400, 409, 422) as ErrRefused; neither creates an
operation.

Fleet uses a claim only if IPAM stored it with reclaim policy Delete,
which overrides the class's, so the claim's deletion removes its
allocation in the same transaction. IPAM ignores delete preconditions.
Release now counts only once a read finds the claim gone and no
IPAllocation names it; a failed delete keeps the address held.

At admission, a claim read that fails for any reason but the claim's
absence leaves the operation Pending and requeues it, instead of
failing it. This holds for every creator; a staff operation is still
cancelled by staff expiry if it is never admitted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A release whose delete removed the claim while an IPAM allocation still
named it reached the allocation check with no test, so replacing that
check left every test passing. A test now holds such a release unverified.
An admission waiting out an IPAM outage also names the read error, so an
operator can tell an outage from a missing grant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells force-pushed the feat/boot-network-site-dhcp branch from 283073c to 5617a92 Compare November 29, 2026 07:18
@scotwells
scotwells force-pushed the feat/ipam-claim-contract branch from 33156b9 to 179e58a Compare November 29, 2026 07:18
@scotwells scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 29, 2026
@scotwells
scotwells requested a review from ecv November 29, 2026 07:19

@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.

Rebase onto the merged power stack. The new Refusal.Retry now sits beside the base's Refusal.Wait, and decide checks Retry first, so an undecided check stays Pending and is never admitted or timed out by the queue wait. The coordinator role conflict resolves to include devicepoweroperations/status. Intent unchanged.

Base automatically changed from feat/boot-network-site-dhcp to feat/manual-inventory-records November 29, 2026 09:01
@scotwells
scotwells requested a review from ecv November 29, 2026 09:06
@scotwells
scotwells merged commit b44f1f1 into feat/manual-inventory-records Nov 29, 2026
20 checks passed
@scotwells
scotwells deleted the feat/ipam-claim-contract branch November 29, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants