diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-16 04:27:16 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-16 04:27:16 -0800 |
| commit | 43101ccea03f45de6d43b41a4d08eba1de1b89e6 (patch) | |
| tree | fcd7481150cecbee07022072133299b32e35a065 /weed/shell/command_volume_server_evacuate.go | |
| parent | 38bbef7ec1e945eef626bf6f638cbb0ec4dbe20b (diff) | |
| download | seaweedfs-43101ccea03f45de6d43b41a4d08eba1de1b89e6.tar.xz seaweedfs-43101ccea03f45de6d43b41a4d08eba1de1b89e6.zip | |
move to the empty nodes first
Diffstat (limited to 'weed/shell/command_volume_server_evacuate.go')
| -rw-r--r-- | weed/shell/command_volume_server_evacuate.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go index 65bf578a0..8acc943cf 100644 --- a/weed/shell/command_volume_server_evacuate.go +++ b/weed/shell/command_volume_server_evacuate.go @@ -180,7 +180,7 @@ func moveAwayOneEcVolume(commandEnv *CommandEnv, ecShardInfo *master_pb.VolumeEc func moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]*VolumeReplica, vol *master_pb.VolumeInformationMessage, thisNode *Node, otherNodes []*Node, applyChange bool) (hasMoved bool, err error) { sort.Slice(otherNodes, func(i, j int) bool { - return otherNodes[i].localVolumeRatio(capacityByMaxVolumeCount(types.ToDiskType(vol.DiskType))) < otherNodes[j].localVolumeRatio(capacityByMaxVolumeCount(types.ToDiskType(vol.DiskType))) + return otherNodes[i].localVolumeRatio(capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))) > otherNodes[j].localVolumeRatio(capacityByFreeVolumeCount(types.ToDiskType(vol.DiskType))) }) for i := 0; i < len(otherNodes); i++ { |
