<fix>[ha]: ZSTAC-83890 backport pre-fence core to 4.8.38 (@@3)#4152
<fix>[ha]: ZSTAC-83890 backport pre-fence core to 4.8.38 (@@3)#4152zstack-robot-2 wants to merge 1 commit into
Conversation
Backport the core HA pre-fence support to 4.8.38. Carry the accessible peer host through HA start messages. Record the pre-fence pending tag after HA state updates, and require a concrete peer before creating the tag. Test: mvn -pl compute -am -DskipTests compile Resolves: ZSTAC-83890 Change-Id: Ic0978d214bf3996ae6fd0c112f125067ce70bed3
走查概览HA 虚拟机启动流程通过新增预围栏系统标签、消息字段扩展和流程异步化,改进主机故障检测与恢复机制。启动消息携带可达对端主机信息,扩展点接口支持异步完成回调,流程链按序执行扩展与消息发送,HA 启动处理根据字段创建预围栏待处理标签。 变更详情HA 虚拟机启动流程异步化与预围栏标签
预估代码审查工作量🎯 4 (复杂) | ⏱️ ~45 分钟 可能相关的 PR
🚥 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 docstrings
🧪 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. 🔧 ast-grep (0.42.3)compute/src/main/java/org/zstack/compute/vm/VmInstanceBase.javaComment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
compute/src/main/java/org/zstack/compute/vm/VmStartOnHypervisorFlow.java (1)
61-61: 💤 Low value建议使用
isEmpty()替代size() > 0。使用
!errorCodeList.getCauses().isEmpty()更符合 Java 惯用写法。♻️ 建议修改
- if (errorCodeList.getCauses().size() > 0) { + if (!errorCodeList.getCauses().isEmpty()) {🤖 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 `@compute/src/main/java/org/zstack/compute/vm/VmStartOnHypervisorFlow.java` at line 61, In VmStartOnHypervisorFlow (around the check using errorCodeList.getCauses()), replace the size() > 0 check with the idiomatic !errorCodeList.getCauses().isEmpty() to improve readability and follow Java conventions; locate the conditional that currently reads errorCodeList.getCauses().size() > 0 and change it to use isEmpty() negation.
🤖 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.
Nitpick comments:
In `@compute/src/main/java/org/zstack/compute/vm/VmStartOnHypervisorFlow.java`:
- Line 61: In VmStartOnHypervisorFlow (around the check using
errorCodeList.getCauses()), replace the size() > 0 check with the idiomatic
!errorCodeList.getCauses().isEmpty() to improve readability and follow Java
conventions; locate the conditional that currently reads
errorCodeList.getCauses().size() > 0 and change it to use isEmpty() negation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 7b81e7c9-6d43-4b63-b15f-ec467d6ee335
📒 Files selected for processing (5)
compute/src/main/java/org/zstack/compute/vm/VmInstanceBase.javacompute/src/main/java/org/zstack/compute/vm/VmStartOnHypervisorFlow.javacompute/src/main/java/org/zstack/compute/vm/VmSystemTags.javaheader/src/main/java/org/zstack/header/vm/HaStartVmInstanceMsg.javaheader/src/main/java/org/zstack/header/vm/VmBeforeStartOnHypervisorExtensionPoint.java
Summary
Backport ZSTAC-83890 core HA pre-fence support to 4.8.38.
This replaces !10055 with branch
4.8.38-ZSTAC-83890@@3and a single squashed commit.Changes
accessiblePeerHostUuidonHaStartVmInstanceMsg.haPreFencePendingafter HA updates VM state/host fields.Testing
git diff --check upstream/4.8.38..HEADmvn -pl compute -am -DskipTests compileResolves: ZSTAC-83890
sync from gitlab !10056