mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 00:58:51 +08:00
shell: volume.tier.move avoid moving all volumes to one destination
This commit is contained in:
@@ -195,6 +195,8 @@ func (c *commandVolumeFixReplication) fixOneUnderReplicatedVolume(commandEnv *Co
|
|||||||
fmt.Fprintf(writer, "replicating volume %d %s from %s to dataNode %s ...\n", replica.info.Id, replicaPlacement, replica.location.dataNode.Id, dst.dataNode.Id)
|
fmt.Fprintf(writer, "replicating volume %d %s from %s to dataNode %s ...\n", replica.info.Id, replicaPlacement, replica.location.dataNode.Id, dst.dataNode.Id)
|
||||||
|
|
||||||
if !takeAction {
|
if !takeAction {
|
||||||
|
// adjust free volume count
|
||||||
|
dst.dataNode.DiskInfos[replica.info.DiskType].FreeVolumeCount--
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -122,6 +122,8 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum
|
|||||||
hasFoundTarget = true
|
hasFoundTarget = true
|
||||||
|
|
||||||
if !applyChanges {
|
if !applyChanges {
|
||||||
|
// adjust volume count
|
||||||
|
dst.dataNode.DiskInfos[string(toDiskType)].VolumeCount++
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,6 +135,9 @@ func doVolumeTierMove(commandEnv *CommandEnv, writer io.Writer, vid needle.Volum
|
|||||||
return fmt.Errorf("move volume %d %s => %s : %v", vid, locations[0].Url, dst.dataNode.Id, err)
|
return fmt.Errorf("move volume %d %s => %s : %v", vid, locations[0].Url, dst.dataNode.Id, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adjust volume count
|
||||||
|
dst.dataNode.DiskInfos[string(toDiskType)].VolumeCount++
|
||||||
|
|
||||||
// remove the remaining replicas
|
// remove the remaining replicas
|
||||||
for _, loc := range locations {
|
for _, loc := range locations {
|
||||||
if loc.Url != dst.dataNode.Id {
|
if loc.Url != dst.dataNode.Id {
|
||||||
|
Reference in New Issue
Block a user