aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_balance.go
diff options
context:
space:
mode:
authorDan <dan@zem.org.uk>2024-07-15 19:17:22 +0100
committerGitHub <noreply@github.com>2024-07-15 11:17:22 -0700
commit794a5aa67de3033ddfc9c77b962d75fa668798ed (patch)
tree5d48dd26228a3d548a9aa2f1d9404f98e31e9761 /weed/shell/command_ec_balance.go
parenta53e406c994ed6c655e4a576855f31dbc883aadb (diff)
downloadseaweedfs-794a5aa67de3033ddfc9c77b962d75fa668798ed.tar.xz
seaweedfs-794a5aa67de3033ddfc9c77b962d75fa668798ed.zip
Add warning with hints to why a EC shard cant be moved (#5790)
Diffstat (limited to 'weed/shell/command_ec_balance.go')
-rw-r--r--weed/shell/command_ec_balance.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/weed/shell/command_ec_balance.go b/weed/shell/command_ec_balance.go
index 17ba63cfe..217e5750e 100644
--- a/weed/shell/command_ec_balance.go
+++ b/weed/shell/command_ec_balance.go
@@ -455,16 +455,20 @@ func doBalanceEcRack(commandEnv *CommandEnv, ecRack *EcRack, applyBalancing bool
func pickOneEcNodeAndMoveOneShard(commandEnv *CommandEnv, averageShardsPerEcNode int, existingLocation *EcNode, collection string, vid needle.VolumeId, shardId erasure_coding.ShardId, possibleDestinationEcNodes []*EcNode, applyBalancing bool) error {
sortEcNodesByFreeslotsDescending(possibleDestinationEcNodes)
-
+ skipReason := ""
for _, destEcNode := range possibleDestinationEcNodes {
+
if destEcNode.info.Id == existingLocation.info.Id {
continue
}
if destEcNode.freeEcSlot <= 0 {
+ skipReason += fmt.Sprintf(" Skipping %s because it has no free slots\n", destEcNode.info.Id)
continue
}
if findEcVolumeShards(destEcNode, vid).ShardIdCount() >= averageShardsPerEcNode {
+ skipReason += fmt.Sprintf(" Skipping %s because it %d >= avernageShards (%d)\n",
+ destEcNode.info.Id, findEcVolumeShards(destEcNode, vid).ShardIdCount(), averageShardsPerEcNode)
continue
}
@@ -477,7 +481,7 @@ func pickOneEcNodeAndMoveOneShard(commandEnv *CommandEnv, averageShardsPerEcNode
return nil
}
-
+ fmt.Printf("WARNING: Could not find suitable taget node for %d.%d:\n%s", vid, shardId, skipReason)
return nil
}