From 013362d2d3077ef3457809d17f1a841c2dbe3d56 Mon Sep 17 00:00:00 2001 From: Copilot Date: Wed, 11 Mar 2026 13:56:13 -0700 Subject: [PATCH] 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. --- weed/shell/command_fs_merge_volumes.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weed/shell/command_fs_merge_volumes.go b/weed/shell/command_fs_merge_volumes.go index 2ed2c0a61..fc1cd160f 100644 --- a/weed/shell/command_fs_merge_volumes.go +++ b/weed/shell/command_fs_merge_volumes.go @@ -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 }