<fix>[kvm]: prevent metadata deletion when DVD returns empty#3642
<fix>[kvm]: prevent metadata deletion when DVD returns empty#3642zstack-robot-1 wants to merge 1 commit into5.5.12from
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough在 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 庆祝诗
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Comment from yaohua.wu: Review: MR !9504 — ZSTAC-83682 (zstack repo)Scope: 业务背景仅升级 MN 的 qemu 并重启后,物理机 变更分析将 验证链路:
Upstream Freshness分支基于 Verdict: APPROVED ✅修复精准,改动最小化(仅移动代码顺序 + 增加 warn 日志),无副作用风险。日志信息 Suggestion
🤖 Robot Reviewer |
When hypervisor metadata collection from DVD returns an empty list, the existing metadata was deleted before the empty check, causing all hosts to lose their hypervisor version metadata and matchState to become Unknown. 1. Why is this change necessary? saveHostOsCategoryList first deleted all existing metadata for the management node, then checked if the input was empty. When DVD collection returned empty, this wiped all metadata, causing matchTargetVersion to be null and matchState to become Unknown. 2. How does it address the problem? Move the empty-list check before the delete operation so that an empty input preserves existing metadata. A warning is logged to indicate the skip. 3. Are there any side effects? None. Non-empty input behavior is unchanged. # Summary of changes (by module): - kvm: move empty check before metadata delete in KvmHypervisorInfoManagerImpl.saveHostOsCategoryList() Related: ZSTAC-83682 Change-Id: I81f9baacac7fce9af2363a0ce5c960532d383890
8f78f0b to
179dfbf
Compare
ZSTAC-83682
Root Cause
When hypervisor metadata collection from DVD returns an empty list (e.g., DVD not mounted),
saveHostOsCategoryListfirst deleted all existing metadata for the management node, then checked if the input was empty. This wiped all metadata, causingmatchTargetVersionto become null andmatchStateto become Unknown, which suppressed hypervisor mismatch alarms.Changes
kvmKvmHypervisorInfoManagerImpl.saveHostOsCategoryList(), preserving existing metadata when DVD collection returns emptyTest
Related MRs
bugfix/ZSTAC-83682@@2→5.5.12Related: ZSTAC-83682
sync from gitlab !9504