ZSTAC-82207 fix stale availablePhysicalCapacity after sync#3348
ZSTAC-82207 fix stale availablePhysicalCapacity after sync#3348MatheMatrix wants to merge 1 commit into5.5.6from
Conversation
syncPhysicalCapacityInCluster() collected fresh physical capacity from KVM agents but did not update per-host LocalStorageHostRefVO. When calculateTotalCapacity() subsequently summed stale host-ref values, it overwrote the correct PS-level capacity with outdated data. 1. Why is this change necessary? After snapshot group migration, the source PS shows decreased availablePhysicalCapacity because the stale host-ref values are used to overwrite the correct agent-reported values. 2. How does it address the problem? Added updatePhysicalCapacityByKvmAgentResponse() call in syncPhysicalCapacityInCluster() to keep host-ref records in sync, consistent with httpCall() pattern. 3. Are there any side effects? None. The redundant PS-level delta update is immediately overwritten by the absolute-value setter. # Summary of changes: - localstorage: update host-ref physical capacity during syncPhysicalCapacityInCluster - test: add LocalStorageSyncPhysicalCapacityCase Related: ZSTAC-82207 Change-Id: I7175962615c3fb9481a872a161f5e107ae91920c
总体概览在KVM代理响应的总容量和可用容量都非空时,新增本地存储容量缓存更新调用。同时增加测试用例验证物理容量同步功能,确保主存储和主机级容量表示同时刷新。 变更内容
代码审查工作量评估🎯 2 (Simple) | ⏱️ ~12 分钟 诗歌
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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. 🔧 ast-grep (0.40.5)plugin/localstorage/src/main/java/org/zstack/storage/primary/local/LocalStorageKvmBackend.javaComment |
|
Comment from yaohua.wu: Code Review: APPROVEDCorrectness: PASS
Impact: Minimal
Suggestion (non-blocking)
Test Coverage: PASS
🤖 Robot Reviewer |
|
Comment from yaohua.wu: ⚡ 更新 Review — 本次 Review 替代以下之前的 Review Code Review: APPROVED ✅问题背景 (ZSTAC-82207)Local-VM 创建快照组后迁移主存储,原存储 修复评估🟢 正确性: PASS
🟢 架构一致性: PASS
🟢 影响范围: 可控
🟢 测试覆盖: PASS
细节观察🟡 Warning (non-blocking): 🟢 Suggestion (non-blocking): 测试用例中 PS 级验证用了 结论修复准确、改动最小、与现有 pattern 一致、有充分测试覆盖。建议合并。 🤖 Robot Reviewer |
Summary
Impact
Related: ZSTAC-82207
sync from gitlab !9177