Skip to content

<fix>[zbs]: skip connected protocol on reconnect#4357

Closed
MatheMatrix wants to merge 1 commit into
feature-zbs-vhostfrom
sync/jin.ma/fix/ZSTAC-86286-skip-connected-deploy
Closed

<fix>[zbs]: skip connected protocol on reconnect#4357
MatheMatrix wants to merge 1 commit into
feature-zbs-vhostfrom
sync/jin.ma/fix/ZSTAC-86286-skip-connected-deploy

Conversation

@MatheMatrix

Copy link
Copy Markdown
Owner

问题

KVM host 连接/重连时 ExternalPrimaryStorageKvmFactory.deployClient 无条件重部署 PS 暴露的所有协议。即使某协议(如 vhost)已 Connected、SPDK target 在跑,每次 reconnect 都会重 deploy 一次,可能打断在该 host 上运行的 vhost VM。reconnect 是每次 host 连接生命周期都会触发的(手动 ReconnectHost / MN 重启 / 自动重连)。

修复

deploy 前查 ExternalPrimaryStorageHostProtocolRefVO,剔除该 (ps,host) 已 Connected 的协议;全部 Connected 则整体跳过。首连(无 ref 行)不受影响仍全 deploy;部分断开只 deploy 未连协议,与 ping 自愈路径 recoverDisconnectedProtocols 的 due-filter 语义一致。

自测

新增 ZbsVhostVolumeCase.testReconnectSkipsConnectedProtocolDeploy:attach→等 Vhost Connected→清 deploy 计数→ReconnectHost→断言 DEPLOY_VHOST 计数为 0。premium build + test 模块编译通过。

Resolves: ZSTAC-86286

sync from gitlab !10317

deployClient 在 host 连接/重连时无条件重部署 PS 暴露的全部协议。
已 Connected 的 vhost target 被重复部署会打断在跑的 vhost VM。
改为只部署该 host 上非 Connected 的协议,全连则跳过;与 ping 自愈的
due-filter 对齐。新增 ZbsVhostVolumeCase.testReconnectSkipsConnectedProtocolDeploy。

Resolves: ZSTAC-86286

Change-Id: I19815e0d90a819feb611c5ff217c8ccf2e96ce54
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 29 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6d45a29b-15d0-498d-abac-eaeaaecb8cfe

📥 Commits

Reviewing files that changed from the base of the PR and between d0d732f and 5f788d3.

📒 Files selected for processing (2)
  • plugin/externalStorage/src/main/java/org/zstack/externalStorage/primary/kvm/ExternalPrimaryStorageKvmFactory.java
  • test/src/test/groovy/org/zstack/test/integration/storage/primary/addon/zbs/ZbsVhostVolumeCase.groovy

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Could not fetch remote config from http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml: TimeoutError: The operation was aborted due to timeout
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/jin.ma/fix/ZSTAC-86286-skip-connected-deploy

Comment @coderabbitai help to get the list of available commands.

@zstack-robot-2 zstack-robot-2 deleted the sync/jin.ma/fix/ZSTAC-86286-skip-connected-deploy branch July 6, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants