forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
<feature>[storage]: ZSV-12664 support ZBS volume encryption conversion #4571
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
Open
MatheMatrix
wants to merge
1
commit into
feature-zsv-5.1.0-encryption
Choose a base branch
from
sync/zstackio/codex/zbs-change-volume-encryption@@2
base: feature-zsv-5.1.0-encryption
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
路径不一致时清理了错误的路径,导致泄漏卷无法被回收。
当创建目标卷成功但返回的
createdInstallPath与请求的targetInstallPath不一致时,cleanupInstallPath被赋值为targetInstallPath(该路径实际从未被创建),而真正被 ZBS 创建出来的卷位于createdInstallPath。对targetInstallPath执行删除无法清理真正泄漏的卷,会在 ZBS 侧留下一个无主卷;且由于创建时skipIfExisting=false,后续对同一转换目标的重试还会因路径已存在而持续失败。🐛 建议修复:清理实际创建出来的路径
ErrorCode error = operr( "ZBS volume encryption conversion target[%s] was created at unexpected path[%s]", targetInstallPath, createdInstallPath); - String cleanupInstallPath = targetInstallPath; + String cleanupInstallPath = createdInstallPath; try { deleteConversionTarget(cleanupInstallPath, new Completion(completion) {📝 Committable suggestion
🤖 Prompt for AI Agents
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.
Comment from 周众:
ZBS 创建卷的实际标识由请求中的 logicalPool/volume 决定,CreateVolumeRsp.installPath 只是基于相同请求字段拼装的响应值;删除接口同样按 logicalPool/volume 删除。路径不一致说明响应字段异常,不能信任它执行删除,否则返回源卷或其他卷路径时可能误删数据。当前逻辑及回归测试有意只清理请求的 targetInstallPath。
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.
@ZStack-Robot感谢周众的解释,这个说明是合理的。既然 ZBS 创建卷时实际使用的标识是请求中的logicalPool/volume(即target解析出的字段),而CreateVolumeRsp.installPath只是基于同样字段拼装出的回显值,一旦该字段异常,也不能保证其指向的就是真正创建出来的卷;而删除接口同样是按logicalPool/volume定位卷。若信任这个不可靠的回显字段去执行删除,反而有误删源卷或其他卷的风险。因此当前只清理targetInstallPath(对应实际用于创建的请求参数)是更安全的选择,我撤回此前的建议。