Skip to content

ZSTAC-84636 backport VM HA orphaned skip-trace fix#4440

Open
zstack-robot-2 wants to merge 1 commit into
5.4.10from
sync/yaohua.wu/bugfix/ZSTAC-84636@@2
Open

ZSTAC-84636 backport VM HA orphaned skip-trace fix#4440
zstack-robot-2 wants to merge 1 commit into
5.4.10from
sync/yaohua.wu/bugfix/ZSTAC-84636@@2

Conversation

@zstack-robot-2

Copy link
Copy Markdown
Collaborator

Root cause:

When a management node leaves, its VM skip-trace entries are removed immediately. If kvmagent is still processing VM start operations from that management node, the next VM sync may see those VMs as stopped and trigger HA, causing split-brain.

Fix:

  • Move departed management node skip-trace entries into an orphaned set instead of deleting them immediately.
  • Include orphaned entries in VM sync skip lists.
  • Keep orphaned entries skipped for a configurable TTL.
  • Add kvm.vm.orphanedSkipTimeout with default value 600 seconds.
  • Use compare-and-remove cleanup to avoid racing with refreshed orphan entries.

Verification:

  • git diff --check
  • mvn -pl plugin/kvm -am -DskipTests compile

Jira: ZSTAC-84636
Related: ZSTAC-80821

sync from gitlab !10401

Backport VM HA skip-trace protection to 5.4.10.

1. Why?
When a management node leaves, its VM skip-trace entries are removed
immediately. If those VMs are still being started by kvmagent, the next
VM sync may treat them as stopped and trigger HA, causing split-brain.

2. How?
Move departed management node skip entries into an orphaned set, keep
them skipped for a configurable TTL, include them in VM sync skip lists,
and remove expired entries with compare-and-remove cleanup.

3. Side effects?
VMs whose controller MN departed stay skipped until the TTL expires.
The default TTL is 600 seconds and can be changed by global config
`kvm.vm.orphanedSkipTimeout`.

# Summary of changes (by module):
- kvm: add orphaned skip set, TTL global config, sync inclusion and CAS cleanup.

Related: ZSTAC-84636
Related: ZSTAC-80821
Change-Id: I7862360c7318cedb51e38939467cf2a7836e61d0
@coderabbitai

coderabbitai Bot commented Jul 3, 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: 36 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: 14ee33e9-e0c6-4b83-be9b-73c1c6d4d7f0

📥 Commits

Reviewing files that changed from the base of the PR and between 08177ca and b0ed121.

📒 Files selected for processing (2)
  • plugin/kvm/src/main/java/org/zstack/kvm/KVMGlobalConfig.java
  • plugin/kvm/src/main/java/org/zstack/kvm/KvmVmSyncPingTask.java

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/yaohua.wu/bugfix/ZSTAC-84636@@2

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

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.

2 participants