<fix>[storage]: decouple alive-chain membership from vmState in VolumeTree#4061
Open
MatheMatrix wants to merge 1 commit into
Open
<fix>[storage]: decouple alive-chain membership from vmState in VolumeTree#4061MatheMatrix wants to merge 1 commit into
MatheMatrix wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough将活跃链判定从 VM 运行态判定中拆出(新增 VolumeTree.isOnAliveChain 与 isHypervisorOperation),并在单快照删除流程中基于活跃链选择待删子节点、调整多子节点处理顺序以保护活跃链。 变更快照删除与活跃链判定
代码审查工作量估算🎯 3 (中等复杂度) | ⏱️ ~22 分钟 诗句
🚥 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)
Comment |
…eTree
VolumeTree previously conflated two independent concepts in isOnline /
resolveDirection:
(a) is the snapshot on the volume's live backing chain (a structural
property of the tree)
(b) is the VM currently routed through the hypervisor (Running/Paused)
Two consequences:
1. In VolumeSnapshotTreeBase.stepDelete, the multi-children "defer
the alive-chain child to the final round" guard used isOnline,
which returned false for every child when the VM was Stopped.
The guard silently disappeared and child selection fell back to
children.get(0), which could land on the volume's backing chain
and corrupt the live chain on rebase failure.
2. resolveDirection's shouldUseCommitStrategy was likewise gated on
vmState, so direction=Auto + Stopped degraded to Pull (writing N
copies of the (target - parent) delta into each child file)
instead of a single-file Commit.
Split into two predicates:
- isOnAliveChain(snapshotUuid): pure tree-structure query, used by
stepDelete to identify the alive child regardless of vmState.
- isHypervisorOperation(vmState): pure run-state predicate, used to
pick libvirt vs primary-storage agent.
isOnline is rewritten as the compound (treeIsCurrent &&
isHypervisorOperation(vmState) && both endpoints on alive chain),
preserving its existing semantics for current callers.
resolveDirection now derives shouldUseCommitStrategy purely from tree
structure, so Auto + Stopped + alive-chain target now picks Commit.
stepDelete renames onlineChild to aliveChild and queries
isOnAliveChain, so the alive-child deferral protection now applies to
Stopped VMs as well.
Resolves: ZSV-10538
Change-Id: I6e63786d6d6b616f7a766b6c7463617572786969
19701c4 to
978db42
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
VolumeTree previously conflated two independent concepts in isOnline /
resolveDirection:
(a) is the snapshot on the volume's live backing chain (a structural
property of the tree)
(b) is the VM currently routed through the hypervisor (Running/Paused)
Two consequences:
the alive-chain child to the final round" guard used isOnline,
which returned false for every child when the VM was Stopped.
The guard silently disappeared and child selection fell back to
children.get(0), which could land on the volume's backing chain
and corrupt the live chain on rebase failure.
vmState, so direction=Auto + Stopped degraded to Pull (writing N
copies of the (target - parent) delta into each child file)
instead of a single-file Commit.
Split into two predicates:
stepDelete to identify the alive child regardless of vmState.
pick libvirt vs primary-storage agent.
isOnline is rewritten as the compound (treeIsCurrent &&
isHypervisorOperation(vmState) && both endpoints on alive chain),
preserving its existing semantics for current callers.
resolveDirection now derives shouldUseCommitStrategy purely from tree
structure, so Auto + Stopped + alive-chain target now picks Commit.
stepDelete renames onlineChild to aliveChild and queries
isOnAliveChain, so the alive-child deferral protection now applies to
Stopped VMs as well.
Resolves: ZSV-10538
Change-Id: I6e63786d6d6b616f7a766b6c7463617572786969
sync from gitlab !9959