refactor(phase2): dedup VTEP registration and suspend-state cleanup - #27
Merged
Conversation
Post-merge cleanup pass over the Phase 2 suspend-on-idle diff:
- Extract ensureVTEPAndFDB helper; route handleScheduled and handleResuming
through it. Resume now registers the VTEP under a vtep_register child span
(previously omitted) and log wording is unified.
- handleTerminating: compute the suspend dir once instead of calling
suspendDirFor twice.
- scheduler: rename NodeInfo.Used{VCPU,MemoryMiB} to Resident{VCPU,MemoryMiB}
to match its documented meaning; inline the single-use oversubscribed local.
- Extract clearSuspendState helper for the two node-loss reschedule branches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-merge
/simplifycleanup pass over the Phase 2 suspend-on-idle diff. No behaviour change intended.Changes
ensureVTEPAndFDBhelper —handleScheduledandhandleResuminghad two near-identical VTEP-register + FDB-sync blocks. Now both route through one helper. Side effect: resume now registers the VTEP under avtep_registerchild span (it was omitted on the resume path before), and the log wording is unified.handleTerminating— computesuspendDirFor(vm)once instead of calling it twice.NodeInfo— renameUsed{VCPU,MemoryMiB}→Resident{VCPU,MemoryMiB}to match the field's documented meaning (resident excludes Suspended VMs); inline the single-useoversubscribedlocal into the log call.clearSuspendStatehelper — the two node-loss reschedule branches each cleared the same two status fields; extracted into one helper.Verification
go build ./...(host +GOOS=linux) cleango test ./internal/controller/...greenGOOS=linux go test -c)