Skip to content

fix(phase2): address review findings (log casing, reserved/resident split, tests) - #26

Merged
syscod3 merged 1 commit into
mainfrom
fix/phase2-review-findings
Jul 6, 2026
Merged

fix(phase2): address review findings (log casing, reserved/resident split, tests)#26
syscod3 merged 1 commit into
mainfrom
fix/phase2-review-findings

Conversation

@syscod3

@syscod3 syscod3 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addresses the two-axis review of the Phase 2 PRs (#23/#24/#25).

Standards

  • Capitalized the 5 new log messages per the repo's kubebuilder logging convention (firecracker_driver.go, reconciler.go).

Spec — Task 4 reserved/resident split (the WRONG finding)

The plan asked to split reserved vs resident; the original impl just excluded Suspended from all accounting. Now explicit:

  • sumUsedResources returns per-node resident (excludes Suspended — memory freed) and reserved (includes Suspended — retains a node claim).
  • Schedule gates on resident only (that IS the overcommit; a reserved gate would cancel it) and logs reserved + an oversubscribed flag for visibility.
  • The plan's contradictory "filter on both freeReserved and freeResident" bullet is corrected in the design doc (gating on reserved would defeat the exit criteria).

Spec — missing tests

  • sumUsedResources: asserts resident = running-only, reserved = running+suspended, terminating excluded.
  • Post-resume VTEP: drives Suspended→Resuming→Running and asserts ImpNetwork.status.vtepTable gets the entry (NodeIP + VMIP) — the ≥15 network-restore risk.

Note (false positive)

The review's "NAT absent from resume" finding was a false positive: NAT is set up inside Driver.Start's setupNetwork (EnsureNetwork+SetupVM+EnsureNAT), which handleResuming calls — same as a cold boot. No change needed.

…split, tests

Standards: capitalize the 5 new log messages per repo convention.

Spec (Task 4): make the reserved/resident split explicit. sumUsedResources now
returns per-node resident (excludes Suspended — the overcommit) and reserved
(includes Suspended, for oversubscription visibility). Schedule gates on
resident only (a reserved gate would cancel overcommit) and logs reserved +
an oversubscribed flag. Resolves the plan's contradictory 'filter on both'.

Tests: sumUsedResources resident/reserved split; post-resume VTEP registration
(the network-restore risk) asserting ImpNetwork.status.vtepTable after resume.
@syscod3
syscod3 merged commit b70d94e into main Jul 6, 2026
17 checks passed
@syscod3
syscod3 deleted the fix/phase2-review-findings branch July 6, 2026 07:41
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