aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_common.go
diff options
context:
space:
mode:
authorLisandro Pin <lisandro.pin@proton.ch>2025-01-29 17:51:59 +0100
committerGitHub <noreply@github.com>2025-01-29 08:51:59 -0800
commit250fbbb3dbe921480ed5022379ed78c7bc164469 (patch)
treeb08c2b0ef11c48d6ab46bf24232719359374d4b7 /weed/shell/command_ec_common.go
parent7913681297b1b986b47366387e844955fac6063b (diff)
downloadseaweedfs-250fbbb3dbe921480ed5022379ed78c7bc164469.tar.xz
seaweedfs-250fbbb3dbe921480ed5022379ed78c7bc164469.zip
`ec.balance`: Allow EC balancing without collections. (#6488)
Diffstat (limited to 'weed/shell/command_ec_common.go')
-rw-r--r--weed/shell/command_ec_common.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go
index afbb750aa..f1d7012d8 100644
--- a/weed/shell/command_ec_common.go
+++ b/weed/shell/command_ec_common.go
@@ -1067,10 +1067,6 @@ func (ecb *ecBalancer) collectVolumeIdToEcNodes(collection string) map[needle.Vo
}
func EcBalance(commandEnv *CommandEnv, collections []string, dc string, ecReplicaPlacement *super_block.ReplicaPlacement, maxParallelization int, applyBalancing bool) (err error) {
- if len(collections) == 0 {
- return fmt.Errorf("no collections to balance")
- }
-
// collect all ec nodes
allEcNodes, totalFreeEcSlots, err := collectEcNodesForDC(commandEnv, dc)
if err != nil {
@@ -1088,11 +1084,15 @@ func EcBalance(commandEnv *CommandEnv, collections []string, dc string, ecReplic
maxParallelization: maxParallelization,
}
+ if len(collections) == 0 {
+ fmt.Printf("WARNING: No collections to balance EC volumes across.")
+ }
for _, c := range collections {
if err = ecb.balanceEcVolumes(c); err != nil {
return err
}
}
+
if err := ecb.balanceEcRacks(); err != nil {
return fmt.Errorf("balance ec racks: %v", err)
}