diff options
| author | chrislu <chris.lu@gmail.com> | 2024-11-18 18:25:38 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-11-18 18:25:44 -0800 |
| commit | bc7650bd61fa34f9aea8476019848f23ea6700bd (patch) | |
| tree | 87c853363713b2cacf552c97d3d56de52d1f5ca7 | |
| parent | f2db746690b903c50d512db568d739a91a00179e (diff) | |
| download | seaweedfs-bc7650bd61fa34f9aea8476019848f23ea6700bd.tar.xz seaweedfs-bc7650bd61fa34f9aea8476019848f23ea6700bd.zip | |
adds more info on skipped volumes
| -rw-r--r-- | weed/shell/command_fs_merge_volumes.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/shell/command_fs_merge_volumes.go b/weed/shell/command_fs_merge_volumes.go index eb401aab1..9499d07bf 100644 --- a/weed/shell/command_fs_merge_volumes.go +++ b/weed/shell/command_fs_merge_volumes.go @@ -206,6 +206,15 @@ func (c *commandFsMergeVolumes) createMergePlan(collection string, toVolumeId ne for i := 0; i < l; i++ { volume := c.volumes[volumes[i]] if volume.GetReadOnly() || c.getVolumeSize(volume) == 0 || (collection != "*" && collection != volume.GetCollection()) { + + if fromVolumeId != 0 && volumes[i] == fromVolumeId || toVolumeId != 0 && volumes[i] == toVolumeId { + if volume.GetReadOnly() { + return nil, fmt.Errorf("volume %d is readonly", volumes[i]) + } + if c.getVolumeSize(volume) == 0 { + return nil, fmt.Errorf("volume %d is empty", volumes[i]) + } + } volumes = slices.Delete(volumes, i, i+1) i-- l-- @@ -229,9 +238,14 @@ func (c *commandFsMergeVolumes) createMergePlan(collection string, toVolumeId ne return nil, err } if !compatible { + fmt.Printf("volume %d is not compatible with volume %d\n", src, condidate) continue } if c.getVolumeSizeBasedOnPlan(plan, condidate)+c.getVolumeSizeById(src) > c.volumeSizeLimit { + fmt.Printf("volume %d (%d MB) merge into volume %d (%d MB) exceeds volume size limit (%d MB)\n", + src, c.getVolumeSizeById(src)/1024/1024, + condidate, c.getVolumeSizeById(condidate)/1024/1024, + c.volumeSizeLimit/1024/1024) continue } plan[src] = condidate |
