fix(nic-health-monitor): classify NICs by PCI address so RDMA renames cannot swap roles #2522
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 585 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.381
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2522"
general
weight: 0.35
KaivalyaMDabhadkar
Summary
Fixes #2521.
nic_topologyingpu_metadata.jsonis keyed by RDMA device name, and those names are not stable: on the reporter's nodes a cloud agent renames every RDMA device about 100 seconds after boot, and the rename is a permutation — each old name still exists afterwards, on a different device. When the metadata collector writes the file before the rename, the NIC health monitor resolves each device's current name to another device's topology row, classifies a healthy by-design-down Ethernet card as compute, and emits a fatalREPLACE_VMevent.This change records the topology by physical device, following the approach the issue suggests:
metadata-collectorresolves each NIC Legend name to its PCI address through/sys/class/infiniband/<name>/device/uevent(PCI_SLOT_NAME, the same source the monitor already reads) and publishes the mapping as a newnic_topology_pci_addressesfield next tonic_topology. It snapshots the name-to-address map before and after thenvidia-smi topo -mrun and collects again (bounded, 3 attempts) when the pairing moved during the run, closing the window where a rename lands mid-collection.nic-health-monitorbuilds a PCI-address index from the new field at load and resolves each device's topology row through the device's own PCI address. A rename after collection can no longer hand a device another device's row.Backwards compatibility: the new field is additive and optional. Files written by older collectors do not carry it, and the monitor then keeps the exact name-keyed behaviour it has today; older monitors ignore the field. No protobuf, CRD, Helm value, metric, or label changes.
This change was prepared with AI assistance; I have reviewed and tested the full diff.
Type of Change
Component(s) Affected
Testing
New tests:
TestClassify_RenamedRDMADevices_UsesPCIAddressRow(nic-health-monitor): reproduces the issue's rename scenario — a file written with boot-time names plus PCI addresses, read in the post-rename world. The device at0000:9a:00.0keeps its own NODE row (storage) instead of the stalemlx5_7PXB row (compute), and0000:41:00.0keeps its compute row under its new name. It fails on the pre-fix classifier and passes with this change.TestClassify_NoPCIAddressesInFile_KeepsNameKeyedBehaviour: control proving files without the new field classify exactly as before.Suites run locally: full
nic-health-monitormodule (all packages pass, topology also under-race),metadata-collectorpackagespkg/nicandpkg/collector, anddata-modelsbuilds. One pre-existing failure is unrelated to this change:pkg/mapper'sTestHostMapper_SeparateCredentials_RequiresPodPatchPermissionneeds envtest control-plane binaries (/usr/local/kubebuilder/bin/etcd), which are not installed on my machine; it fails identically on unmodifiedmain. I could not runmake lint-test-alllocally for the same tooling reason (golangci-lint is provisioned bymake dev-env-setup);go vetandgofmtare clean on the changed packages.Checklist
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
NIC topology metadata now records PCI addresses when available, limited to devices included in the collected topology.
Health classification can match topology rows by PCI address when RDMA device names change. Older metadata continues to use name-based lookup; when a recorded address no longer matches, classification falls back to NUMA-based behavior.
Topology collection retries up to three times if device addresses change during a scan. If addresses cannot be read or remain unstable, collection can proceed without PCI-address metadata.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->