|
|
@ -11,11 +11,8 @@ import ( |
|
|
|
"golang.org/x/exp/slices" |
|
|
|
"io" |
|
|
|
"os" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
const topologyInfoUpdateInterval = 5 * time.Minute |
|
|
|
|
|
|
|
func init() { |
|
|
|
Commands = append(Commands, &commandVolumeServerEvacuate{}) |
|
|
|
} |
|
|
@ -117,13 +114,9 @@ func (c *commandVolumeServerEvacuate) evacuateNormalVolumes(commandEnv *CommandE |
|
|
|
} |
|
|
|
|
|
|
|
// move away normal volumes
|
|
|
|
ticker := time.NewTicker(topologyInfoUpdateInterval) |
|
|
|
defer ticker.Stop() |
|
|
|
for _, thisNode := range thisNodes { |
|
|
|
for _, diskInfo := range thisNode.info.DiskInfos { |
|
|
|
if applyChange { |
|
|
|
select { |
|
|
|
case <-ticker.C: |
|
|
|
if topologyInfo, _, err := collectTopologyInfo(commandEnv, 0); err != nil { |
|
|
|
fmt.Fprintf(writer, "update topologyInfo %v", err) |
|
|
|
} else { |
|
|
@ -136,7 +129,6 @@ func (c *commandVolumeServerEvacuate) evacuateNormalVolumes(commandEnv *CommandE |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
volumeReplicas, _ := collectVolumeReplicaLocations(c.topologyInfo) |
|
|
|
for _, vol := range diskInfo.VolumeInfos { |
|
|
|
hasMoved, err := moveAwayOneNormalVolume(commandEnv, volumeReplicas, vol, thisNode, otherNodes, applyChange) |
|
|
|