<feature>[zns]: ZNS SDN controller integration - Wave 1-6 (ZCF-2133)#3884
<feature>[zns]: ZNS SDN controller integration - Wave 1-6 (ZCF-2133)#3884zstack-robot-1 wants to merge 1 commit intofeature-5.5.22-zcf-temporaryfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough新增 ZNS 数据模型(ZnsTenantVO、ZnsTenantRouterVO),为 ZnsTransportZoneVO 添加 znsResourceUuid 与复合唯一约束;扩展 SdnControllerStatus(Syncing、Ready);Ping 跟踪器在 Syncing/Ready 或找不到记录时跳过处理;新增 10 个 ZNS 相关错误码常量。 Changes
Sequence Diagram(s)sequenceDiagram
participant PingTracker as PingTracker
participant DB as Database
participant Controller as SdnController (VO)
participant Network as NetworkService
PingTracker->>DB: 查找 controller by uuid
alt record not found
DB-->>PingTracker: null
PingTracker-->>Network: 不发送 ping(返回 null)
else record found
DB-->>PingTracker: controller (status)
alt status is Syncing/Ready
PingTracker-->>Network: 跳过发送 ping(受管状态)
else other statuses
PingTracker->>Network: 生成并发送 ping 消息
Network-->>PingTracker: ping reply
PingTracker->>DB: 根据 reply 更新 controller 状态
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 分钟 Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@conf/db/upgrade/V5.5.18__schema.sql`:
- Line 40: The migration currently defines the column `description` as
VARCHAR(2048); change its type to TEXT to avoid truncation from unbounded
external ZNS data: replace `description VARCHAR(2048) DEFAULT NULL` with
`description TEXT DEFAULT NULL` in the migration and any other SQL statements in
the same migration that create or alter this `description` column, ensuring
indexes/constraints remain valid after the type change.
🪄 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: 3f1853d2-762d-4d68-8037-add5989f5954
📒 Files selected for processing (4)
conf/db/upgrade/V5.5.18__schema.sqlheader/src/main/java/org/zstack/header/network/sdncontroller/SdnControllerStatus.javaplugin/sdnController/src/main/java/org/zstack/sdnController/SdnControllerPingTracker.javautils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
fe2aab5 to
7f7b000
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugin/sdnController/src/main/java/org/zstack/sdnController/SdnControllerPingTracker.java (1)
56-59: 建议在资源缺失时主动 untrack,避免重复告警Line 56-59 当前仅返回
null,若跟踪集中仍有该 UUID,会持续触发无效查询与 warn 日志。建议这里直接untrack(resUuid)做自愈。建议修改
if (vo == null) { logger.warn(String.format("SDN controller[uuid:%s] has been deleted, skip ping sending", resUuid)); + untrack(resUuid); return null; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@plugin/sdnController/src/main/java/org/zstack/sdnController/SdnControllerPingTracker.java` around lines 56 - 59, In SdnControllerPingTracker inside the method containing the vo null-check, when vo == null currently you only return null; instead call the tracker’s untrack(resUuid) before returning to remove the UUID from the tracking set and prevent repeated warn logs and pointless lookups—i.e., invoke untrack(resUuid) (or the class method used to stop tracking) then log if needed and return null.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@plugin/sdnController/src/main/java/org/zstack/sdnController/SdnControllerPingTracker.java`:
- Around line 56-59: In SdnControllerPingTracker inside the method containing
the vo null-check, when vo == null currently you only return null; instead call
the tracker’s untrack(resUuid) before returning to remove the UUID from the
tracking set and prevent repeated warn logs and pointless lookups—i.e., invoke
untrack(resUuid) (or the class method used to stop tracking) then log if needed
and return null.
ℹ️ 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: 69260cbe-bdad-4417-9e0d-7a9d138eb84c
📒 Files selected for processing (4)
conf/db/upgrade/V5.5.18__schema.sqlheader/src/main/java/org/zstack/header/network/sdncontroller/SdnControllerStatus.javaplugin/sdnController/src/main/java/org/zstack/sdnController/SdnControllerPingTracker.javautils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
✅ Files skipped from review due to trivial changes (1)
- utils/src/main/java/org/zstack/utils/clouderrorcode/CloudOperationsErrorCode.java
🚧 Files skipped from review as they are similar to previous changes (1)
- conf/db/upgrade/V5.5.18__schema.sql
7f7b000 to
3c8a633
Compare
|
Comment from shixin.ruan: 已修复:在 getPingMessage() 的 vo == null 分支中添加 untrack(resUuid),自愈避免重复 warn 日志,commit 476676b。 |
72cc52f to
1e4e01d
Compare
ZCF-2133: integrate ZNS SDN controller into ZStack Cloud Wave 1: ZNS SDN controller DB/API/factory Wave 2: sync ZNS resources on wizard init Wave 3: ZNS L2/L3 network with tenant router support Wave 4: ZNS VM NIC DPDK/OVS kernel type selection Wave 5: ZNS reverse notification handler Wave 6: ZNS reconciliation and periodic sync Related: ZCF-2133 Change-Id: I524eb17e74b1818d806f58886a6c300b461a2e20
1e4e01d to
c46bfab
Compare
ZNS SDN Controller integration - schema, error codes, status, ping tracker
Resolves: ZCF-2133
sync from gitlab !9764