feat(volume.fix): show all replica locations for misplaced volumes (#7560)
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"slices"
|
"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))
|
fmt.Fprintf(writer, "volume %d replication %s, but under replicated %+d\n", replica.info.Id, replicaPlacement, len(replicas))
|
||||||
case isMisplaced(replicas, replicaPlacement):
|
case isMisplaced(replicas, replicaPlacement):
|
||||||
misplacedVolumeIds = append(misplacedVolumeIds, vid)
|
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):
|
case replicaPlacement.GetCopyCount() < len(replicas):
|
||||||
overReplicatedVolumeIds = append(overReplicatedVolumeIds, vid)
|
overReplicatedVolumeIds = append(overReplicatedVolumeIds, vid)
|
||||||
fmt.Fprintf(writer, "volume %d replication %s, but over replicated %+d\n", replica.info.Id, replicaPlacement, len(replicas))
|
fmt.Fprintf(writer, "volume %d replication %s, but over replicated %+d\n", replica.info.Id, replicaPlacement, len(replicas))
|
||||||
|
|||||||
Reference in New Issue
Block a user