volume.tier.move: avoid repeated move for replicated volumes

fix https://github.com/chrislusf/seaweedfs/issues/1792#issuecomment-784139348
This commit is contained in:
Chris Lu 2021-02-23 03:49:14 -08:00
parent 37f104f88f
commit 9edd964627

View file

@ -102,7 +102,7 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, collection strin
keepDataNodesSorted(allLocations, toDiskType)
fn := capacityByFreeVolumeCount(toDiskType)
for _, dst := range allLocations {
if fn(dst.dataNode) > 0 {
if fn(dst.dataNode) > 0 && !hasFoundTarget {
// ask the volume server to replicate the volume
if isOneOf(dst.dataNode.Id, locations) {
continue