fix(shell): show planned size in fs.mergeVolumes log to clarify size limit check (#8553)
The log message was comparing against the planned size of the destination volume (including volumes already planned to merge into it) but only displaying the raw volume size, making the output confusing when the displayed sizes clearly didn't add up to exceed the limit.
This commit is contained in:
@@ -244,10 +244,11 @@ func (c *commandFsMergeVolumes) createMergePlan(collection string, toVolumeId ne
|
||||
fmt.Printf("volume %d is not compatible with volume %d\n", src, candidate)
|
||||
continue
|
||||
}
|
||||
if c.getVolumeSizeBasedOnPlan(plan, candidate)+c.getVolumeSizeById(src) > c.volumeSizeLimit {
|
||||
fmt.Printf("volume %d (%d MB) merge into volume %d (%d MB) exceeds volume size limit (%d MB)\n",
|
||||
candidatePlannedSize := c.getVolumeSizeBasedOnPlan(plan, candidate)
|
||||
if candidatePlannedSize+c.getVolumeSizeById(src) > c.volumeSizeLimit {
|
||||
fmt.Printf("volume %d (%d MB) merge into volume %d (%d MB, %d MB with plan) exceeds volume size limit (%d MB)\n",
|
||||
src, c.getVolumeSizeById(src)/1024/1024,
|
||||
candidate, c.getVolumeSizeById(candidate)/1024/1024,
|
||||
candidate, c.getVolumeSizeById(candidate)/1024/1024, candidatePlannedSize/1024/1024,
|
||||
c.volumeSizeLimit/1024/1024)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user