aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsteve.wei <coderushing@gmail.com>2025-11-27 16:04:45 +0800
committerGitHub <noreply@github.com>2025-11-27 00:04:45 -0800
commit5c25df20f254f8db7650a1e38b4c2c297ee020b8 (patch)
treedbc1f83c5355d1e366ec660d3dac4a72c20ef326
parent865fc88b3bcef1e96a20e3bd414c94381fe8c149 (diff)
downloadseaweedfs-5c25df20f254f8db7650a1e38b4c2c297ee020b8.tar.xz
seaweedfs-5c25df20f254f8db7650a1e38b4c2c297ee020b8.zip
feat(volume.fix): show all replica locations for misplaced volumes (#7560)
-rw-r--r--weed/shell/command_volume_fix_replication.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index f4dd0239a..96bd41711 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -7,6 +7,7 @@ import (
"io"
"path/filepath"
"strconv"
+ "strings"
"time"
"slices"
@@ -116,7 +117,11 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv,
fmt.Fprintf(writer, "volume %d replication %s, but under replicated %+d\n", replica.info.Id, replicaPlacement, len(replicas))
case isMisplaced(replicas, replicaPlacement):
misplacedVolumeIds = append(misplacedVolumeIds, vid)
- fmt.Fprintf(writer, "volume %d replication %s is not well placed %s\n", replica.info.Id, replicaPlacement, replica.location.dataNode.Id)
+ locations := make([]string, 0, len(replicas))
+ for _, r := range replicas {
+ locations = append(locations, r.location.String())
+ }
+ fmt.Fprintf(writer, "volume %d replication %s is not well placed [%s]\n", replica.info.Id, replicaPlacement, strings.Join(locations, ", "))
case replicaPlacement.GetCopyCount() < len(replicas):
overReplicatedVolumeIds = append(overReplicatedVolumeIds, vid)
fmt.Fprintf(writer, "volume %d replication %s, but over replicated %+d\n", replica.info.Id, replicaPlacement, len(replicas))