Skip to content

fix: Volcengine adopt uses the ENI secondary IPs; daemon survives a detached ENI - #15

Merged
CMGS merged 6 commits into
mainfrom
review/night-2026-09-03
Sep 2, 2026
Merged

fix: Volcengine adopt uses the ENI secondary IPs; daemon survives a detached ENI#15
CMGS merged 6 commits into
mainfrom
review/night-2026-09-03

Conversation

@CMGS

@CMGS CMGS commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Whole-repo quality round (2026-09-03): every Go file read against the /code Style Self-Check and the judgment lenses; three commits.

  1. fixadopt derived the DHCP pool from the subnet on every platform, but a Volcengine VPC routes only the ENI-assigned secondary IPs to the node (docs/volcengine.md: "secondary private IPs are assigned to each ENI — these become the DHCP pool"), so an adopted node leased unroutable addresses, ENI primaries included. adopt now seeds the pool from the one ENI read Status already performs (nothing is created or changed; README/architecture/volcengine/configuration/dhcp docs updated). The pool keeps only the ENI secondary IPs inside --subnet (minus the gateway, deduplicated) and fails when none remain. The daemon still refuses to start over a missing secondary link: the flat pool cannot drop a detached ENI's addresses, so continuing would lease unroutable IPs (held; a safe degrade needs the state file to record ENI membership).
  2. cutpendingOffers.add could never report a displaced IP (the caller resolves the MAC's live offer first and drops an expired one); restore(l) was restoreAll with one element; the GKE Adopt NIC fallback never ran (cmd/adopt resolves it first).
  3. review--version carries rev and build time like every sibling (the Makefile and goreleaser already injected them); package docs shrink to one line with the subprocess WHY at the call sites; test files carry no comments; docs/gke.md states that adopt fails where init only warns.

Held with measurement: lease.save() under lifecycleMu per DHCP ACK is ~0.2–0.3 ms (three syscalls; 43 ms serialized across a 140-IP boot storm) and the persist-before-ACK / persist-before-free ordering is test-pinned, so no change. activeCount materializing leases per Prometheus scrape (~11 KB every scrape) stays.

Gates: GOWORK=off make lint 0 issues on linux and darwin; make fmt-check clean; asl ./... clean on both GOOS; GOWORK=off go test -race -count=1 ./... green. Round diff: 21 files, +45/−65; comment lines +3/−30.

CMGS added 6 commits September 3, 2026 01:34
…ched NICs

adopt derived the pool from the subnet on every platform, but a VPC
routes only the assigned ENI secondary IPs to a Volcengine node, so an
adopted node leased unroutable addresses, ENI primaries included. The
pool now comes from the one ENI read Status already performs; init and
the docs already said the ENI secondaries are the pool.

setupSecondaryNICs is the first step of node.Setup and fails hard on a
missing link, so one out-of-band ENI detach put the daemon into a systemd
restart loop with no DHCP. adopt already filters with PresentLinks; the
daemon does the same.
… fallback

pendingOffers.add could never report a displaced IP: offerIP resolves
the MAC's live offer first and drops an expired one, so the map entry is
absent or already equal. restore(l) was restoreAll with one element.
cmd/adopt resolves the primary NIC before calling Adopt, so the cmp.Or
fallback never ran.
Every sibling surfaces REVISION and BUILTAT; cocoon-net injected them at
build time and dropped them. Package docs shrink to one line, the
subprocess WHY moves to the one call site each, test files carry no
comments, docs/gke.md states that adopt fails where init only warns.
…t; the daemon stays fail-fast on a missing link

Status lists every ENI on the instance, so the pool now keeps only the
secondary IPs inside --subnet, minus the gateway, deduplicated, and
fails when none remain. The daemon keeps refusing to start over a
missing secondary link: the flat pool cannot drop the detached ENI's
addresses, so continuing would lease unroutable IPs.
…sent link per pool ENI

HostPrefix carries the gateway/broadcast validation SubnetIPs performed,
so the Volcengine path rejects a malformed or out-of-subnet --gateway
before any discovery. PoolStatus reports secondary IPs per ENI; adopt
counts the ENIs that contribute pool addresses and refuses to persist a
pool whose ENIs outnumber the present secondary links, instead of
silently keeping a detached ENI's addresses.
Counting links against ENIs cannot tell an ENI whose link is missing from an
unrelated ENI whose link is present; the Volcengine status now carries each
ENI's MAC and adopt refuses when a pool ENI has no link with that address.
@CMGS
CMGS merged commit ecf1ffc into main Sep 2, 2026
2 checks passed
@CMGS
CMGS deleted the review/night-2026-09-03 branch September 2, 2026 19:03
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.

1 participant