aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-27 00:21:59 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-27 00:21:59 -0800
commit1045ab8b074e1b2d49de566dcfd384fc57b58d2c (patch)
tree5ae7be29ac24340b46ae26b5fee22c6e5cead9bb
parent0488c84beac91a57d9383252b8c58fb6b0ebd84d (diff)
downloadseaweedfs-1045ab8b074e1b2d49de566dcfd384fc57b58d2c.tar.xz
seaweedfs-1045ab8b074e1b2d49de566dcfd384fc57b58d2c.zip
avoid error message
-rw-r--r--weed/shell/command_volume_fix_replication.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go
index c737133f5..d3fa7d4ac 100644
--- a/weed/shell/command_volume_fix_replication.go
+++ b/weed/shell/command_volume_fix_replication.go
@@ -162,6 +162,7 @@ func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *Comm
replica := pickOneReplicaToCopyFrom(replicas)
replicaPlacement, _ := super_block.NewReplicaPlacementFromByte(byte(replica.info.ReplicaPlacement))
foundNewLocation := false
+ hasSkippedCollection := false
for _, dst := range allLocations {
// check whether data nodes satisfy the constraints
if dst.dataNode.FreeVolumeCount > 0 && satisfyReplicaPlacement(replicaPlacement, replicas, dst) {
@@ -172,6 +173,7 @@ func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *Comm
return fmt.Errorf("match pattern %s with collection %s: %v", *c.collectionPattern, replica.info.Collection, err)
}
if !matched {
+ hasSkippedCollection = true
break
}
}
@@ -205,7 +207,7 @@ func (c *commandVolumeFixReplication) fixUnderReplicatedVolumes(commandEnv *Comm
break
}
}
- if !foundNewLocation {
+ if !foundNewLocation && !hasSkippedCollection {
fmt.Fprintf(writer, "failed to place volume %d replica as %s, existing:%+v\n", replica.info.Id, replicaPlacement, len(replicas))
}