[ZSTAC-85134] Carry cache pool capacity in KVM responses#3958
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ 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)
Walkthrough将池容量字段统一移入新基类 变更内容池响应类层级整合
估计代码审查工作量🎯 3 (Moderate) | ⏱️ ~20 minutes 兔子的诗
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Comment from yaohua.wu: Review: MR !9849 — ZSTAC-85134关联 MR
本 MR 是这套修复的"线协议基线":在 跨仓一致性核查
Findings🟢 Suggestion — 文档化 PoolHealthRsp 的语义扩展
建议:要么在类上加一行注释说明 health response 也会携带最新容量;要么如果你觉得健康通道不该承担容量同步职责,则在 Coverage
Verdict: APPROVED线协议变更最小、对称、向下兼容。无阻塞性问题。 🤖 Robot Reviewer |
738bef5 to
87ad2f5
Compare
|
Comment from haidong.pang: 已调整:PoolHealthRsp 不再继承 PoolRsp,check_pool 响应不携带容量,容量只放在会改变缓存池状态的 pool 操作响应里。used 字段也已经从协议中移除。 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugin/kvm/src/main/java/org/zstack/kvm/KVMAgentCommands.java`:
- Around line 5272-5284: The PoolRsp model in KVMAgentCommands is missing the
'used' capacity field and PoolHealthRsp should extend PoolRsp so health
responses reuse the same capacity carrier; update the PoolRsp class to add a
public Long used; then change PoolHealthRsp to extend PoolRsp (retain its public
Boolean healthy and public String reason fields) so health responses include
poolUuid/mountPoint/total/available/allocated/dirty/used; make the analogous
changes to the other duplicate definitions mentioned (the other
PoolRsp/PoolHealthRsp occurrences).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)
Review profile: CHILL
Plan: Pro
Run ID: 2e9f4772-c784-4d32-9c4b-76a367334d1f
📒 Files selected for processing (1)
plugin/kvm/src/main/java/org/zstack/kvm/KVMAgentCommands.java
| public static class PoolRsp extends AgentResponse { | ||
| public String poolUuid; | ||
| public String mountPoint; | ||
| public Long total; | ||
| public Long available; | ||
| public Long allocated; | ||
| public Long dirty; | ||
| } | ||
|
|
||
| public static class PoolHealthRsp extends AgentResponse { | ||
| public Boolean healthy; | ||
| public String reason; | ||
| } |
There was a problem hiding this comment.
缓存池响应模型未完整对齐容量协议(缺 used 且 PoolHealthRsp 未继承 PoolRsp)。
当前实现会导致容量字段集合不完整,并且健康响应无法复用同一容量载体;这与本次“统一从响应刷新容量”的目标不一致。
建议修改
public static class PoolRsp extends AgentResponse {
public String poolUuid;
public String mountPoint;
public Long total;
+ public Long used;
public Long available;
public Long allocated;
public Long dirty;
}
-public static class PoolHealthRsp extends AgentResponse {
+public static class PoolHealthRsp extends PoolRsp {
public Boolean healthy;
public String reason;
}Also applies to: 5286-5287, 5295-5298
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugin/kvm/src/main/java/org/zstack/kvm/KVMAgentCommands.java` around lines
5272 - 5284, The PoolRsp model in KVMAgentCommands is missing the 'used'
capacity field and PoolHealthRsp should extend PoolRsp so health responses reuse
the same capacity carrier; update the PoolRsp class to add a public Long used;
then change PoolHealthRsp to extend PoolRsp (retain its public Boolean healthy
and public String reason fields) so health responses include
poolUuid/mountPoint/total/available/allocated/dirty/used; make the analogous
changes to the other duplicate definitions mentioned (the other
PoolRsp/PoolHealthRsp occurrences).
Add cache pool capacity fields to mutating pool-related KVM agent response DTOs so MN can refresh capacity from operation responses. Resolves: ZSTAC-85134 Change-Id: I04b8c898a8fcc213f025a4db848e2f4cb97689f5
87ad2f5 to
39d16f6
Compare
为缓存池相关 KVM agent response 统一补充容量字段,使 PoolRsp、PoolHealthRsp、PoolCapacityRsp、GCPoolRsp 都能携带当前缓存池容量信息,供 MN 在业务响应中直接刷新容量。
sync from gitlab !9849