forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
[ZSTAC-83890] Ceph HA: sibling-fence VM before HA recreate@@3 #3896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
MatheMatrix
wants to merge
1
commit into
5.4.8
from
sync/yingzhe.hu/fix/ZSTAC-83890-ceph-ha-sibling-fence@@3
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
header/src/main/java/org/zstack/header/storage/ceph/CephSiblingFenceExtensionPoint.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package org.zstack.header.storage.ceph; | ||
|
|
||
| import org.zstack.header.core.ReturnValueCompletion; | ||
|
|
||
| /** | ||
| * SPI for Ceph HA sibling-fence (ZSTAC-83890). | ||
| * Implementation lives in premium {@code storage-ha-plugin}. | ||
| * Called from {@code CephPrimaryStorageFactory.preInstantiateVmResource} when | ||
| * Ceph watcher list is empty — SSH-kills stale QEMU on the failed host before | ||
| * HA starts the VM to prevent split-brain. | ||
| */ | ||
| public interface CephSiblingFenceExtensionPoint { | ||
| void fenceVmOnFailedHost(String failedHostUuid, | ||
| String vmUuid, | ||
| String clusterUuid, | ||
| String haTargetHostUuid, | ||
| ReturnValueCompletion<SiblingFenceVmOnHostReply> completion); | ||
| } |
42 changes: 42 additions & 0 deletions
42
header/src/main/java/org/zstack/header/storage/ceph/SiblingFenceVmOnHostMsg.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package org.zstack.header.storage.ceph; | ||
|
|
||
| import org.zstack.header.message.NeedReplyMessage; | ||
|
|
||
| public class SiblingFenceVmOnHostMsg extends NeedReplyMessage { | ||
| private String failedHostUuid; | ||
| private String vmUuid; | ||
| private String clusterUuid; | ||
| private String haTargetHostUuid; | ||
|
|
||
| public String getFailedHostUuid() { | ||
| return failedHostUuid; | ||
| } | ||
|
|
||
| public void setFailedHostUuid(String failedHostUuid) { | ||
| this.failedHostUuid = failedHostUuid; | ||
| } | ||
|
|
||
| public String getVmUuid() { | ||
| return vmUuid; | ||
| } | ||
|
|
||
| public void setVmUuid(String vmUuid) { | ||
| this.vmUuid = vmUuid; | ||
| } | ||
|
|
||
| public String getClusterUuid() { | ||
| return clusterUuid; | ||
| } | ||
|
|
||
| public void setClusterUuid(String clusterUuid) { | ||
| this.clusterUuid = clusterUuid; | ||
| } | ||
|
|
||
| public String getHaTargetHostUuid() { | ||
| return haTargetHostUuid; | ||
| } | ||
|
|
||
| public void setHaTargetHostUuid(String haTargetHostUuid) { | ||
| this.haTargetHostUuid = haTargetHostUuid; | ||
| } | ||
| } |
69 changes: 69 additions & 0 deletions
69
header/src/main/java/org/zstack/header/storage/ceph/SiblingFenceVmOnHostReply.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| package org.zstack.header.storage.ceph; | ||
|
|
||
| import org.zstack.header.message.MessageReply; | ||
|
|
||
| public class SiblingFenceVmOnHostReply extends MessageReply { | ||
| private boolean alive; | ||
| private boolean killed; | ||
| private boolean sshReachable; | ||
| private boolean qemuFound; | ||
| private String executorHostUuid; | ||
| private String executorRole; | ||
| private String reason; | ||
|
|
||
| public boolean isAlive() { | ||
| return alive; | ||
| } | ||
|
|
||
| public void setAlive(boolean alive) { | ||
| this.alive = alive; | ||
| } | ||
|
|
||
| public boolean isKilled() { | ||
| return killed; | ||
| } | ||
|
|
||
| public void setKilled(boolean killed) { | ||
| this.killed = killed; | ||
| } | ||
|
|
||
| public boolean isSshReachable() { | ||
| return sshReachable; | ||
| } | ||
|
|
||
| public void setSshReachable(boolean sshReachable) { | ||
| this.sshReachable = sshReachable; | ||
| } | ||
|
|
||
| public boolean isQemuFound() { | ||
| return qemuFound; | ||
| } | ||
|
|
||
| public void setQemuFound(boolean qemuFound) { | ||
| this.qemuFound = qemuFound; | ||
| } | ||
|
|
||
| public String getExecutorHostUuid() { | ||
| return executorHostUuid; | ||
| } | ||
|
|
||
| public void setExecutorHostUuid(String executorHostUuid) { | ||
| this.executorHostUuid = executorHostUuid; | ||
| } | ||
|
|
||
| public String getExecutorRole() { | ||
| return executorRole; | ||
| } | ||
|
|
||
| public void setExecutorRole(String executorRole) { | ||
| this.executorRole = executorRole; | ||
| } | ||
|
|
||
| public String getReason() { | ||
| return reason; | ||
| } | ||
|
|
||
| public void setReason(String reason) { | ||
| this.reason = reason; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未显式放行 SSH 不可达分支,可能误阻断 HA 拉起
Line [1262] 仅判断
!r.isAlive() || r.isKilled()。按本 PR 目标存在success-ssh-unreachable成功态;若扩展实现返回sshReachable=false且alive=true(或后续实现调整),这里会错误进入completion.fail(),导致可恢复场景被阻断。建议把!r.isSshReachable()作为明确成功条件,避免依赖实现细节。🔧 建议修复
🤖 Prompt for AI Agents