fix(nvca): apply primary-PV selector in model cache cleanup#441
fix(nvca): apply primary-PV selector in model cache cleanup#441mesutoezdil wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe primary PV selector now retains its label requirement, and a unit test verifies that it rejects unlabeled objects and matches PVs with the primary label. ChangesPrimary PV selector
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
labels.Selector.Add returns a new selector and does not mutate the receiver, so the discarded return left primaryPVSel empty. An empty selector matches every object, so the idle model cache cleanup listed every PV in the cluster instead of only model-cache primary PVs. This skewed the model cache backend count metric and made the cleanup loop scan all PVs each tick. Reassign the Add result so the primary-PV requirement is applied, and add a regression test on the selector. Closes NVIDIA#440 Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
bec4165 to
2647a51
Compare
TL;DR
The model cache cleanup selector was left empty because the result of
labels.Selector.Addwas discarded. An empty selector matches every object, soidle cleanup listed every PV in the cluster instead of only model-cache primary
PVs. This skewed the model cache backend count metric and made the cleanup loop
scan all PVs each tick. Reassign the
Addresult so the requirement applies, plusa regression test.
Issues
Closes #440
Testing
go test ./pkg/storage/...with envtest passes. AddedTestPrimaryPVSelector,which fails before the fix (empty selector matches an empty label set) and passes
after. No QA needed.
Checklist
Summary by CodeRabbit
Bug Fixes
Tests