<fix>[storage]: honor force flag to clean image cache for existing images with no VMs (ZSTAC-79628)#3404
Open
zstack-robot-1 wants to merge 1 commit into5.5.12from
Open
<fix>[storage]: honor force flag to clean image cache for existing images with no VMs (ZSTAC-79628)#3404zstack-robot-1 wants to merge 1 commit into5.5.12from
zstack-robot-1 wants to merge 1 commit into5.5.12from
Conversation
…ages with no VMs Resolves: ZSTAC-79628 Change-Id: I5a7a0941a59bcea132ea97df52bbebdc9a227508
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml) Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
总体说明将图像缓存清理逻辑中的硬编码布尔值替换为参数 变更清单
代码审查工作量估算🎯 2 (Simple) | ⏱️ ~10 分钟 诗歌颂
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (1 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
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.
Problem
When calling
APICleanUpImageCacheOnPrimaryStorageMsgwithforce=true, the intention is to also clean up image cache entries for images that still exist but have no VMs using them. However,createShadowImageCacheVOsForNewDeletedAndOldin both the base class (ImageCacheCleaner) andCephImageCacheCleanerhardcodedfalsewhen callinggetStaleImageCacheIds, ignoring theparam.includeReadyImageflag.Fix
Pass
param.includeReadyImagetogetStaleImageCacheIdsin:ImageCacheCleaner.createShadowImageCacheVOsForNewDeletedAndOld(covers NFS, SMP, SharedBlock)CephImageCacheCleaner.createShadowImageCacheVOsForNewDeletedAndOldWith this fix, calling the cleanup API with
force=truewill now correctly clean image caches that meet the criteria:Note:
LocalStorageImageCleaneralready usedparam.includeReadyImagecorrectly.Resolves: ZSTAC-79628
sync from gitlab !9252