aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyang <wings.wyang@gmail.com>2024-07-27 12:36:56 +0800
committerGitHub <noreply@github.com>2024-07-26 21:36:56 -0700
commitc1bffca24608554952bf03f0a11838aaa567a78a (patch)
tree0129a63d7ab392f19b3fdc683a624050382c57d2
parente2a07d11d5127edad63bdae12a8f911a29e729c1 (diff)
downloadseaweedfs-c1bffca24608554952bf03f0a11838aaa567a78a.tar.xz
seaweedfs-c1bffca24608554952bf03f0a11838aaa567a78a.zip
fix evacuate volume to different disk types (#5530)
Co-authored-by: wyang <wyang@wyangs-Air.lan>
-rw-r--r--weed/shell/command_volume_server_evacuate.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/shell/command_volume_server_evacuate.go b/weed/shell/command_volume_server_evacuate.go
index 57eb6fc45..bad695cd7 100644
--- a/weed/shell/command_volume_server_evacuate.go
+++ b/weed/shell/command_volume_server_evacuate.go
@@ -3,14 +3,15 @@ package shell
import (
"flag"
"fmt"
+ "io"
+ "os"
+
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
- "io"
- "os"
)
func init() {
@@ -219,7 +220,7 @@ func moveAwayOneNormalVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][
})
for i := 0; i < len(otherNodes); i++ {
emptyNode := otherNodes[i]
- if freeVolumeCountfn(emptyNode.info) < 0 {
+ if freeVolumeCountfn(emptyNode.info) <= 0 {
continue
}
hasMoved, err = maybeMoveOneVolume(commandEnv, volumeReplicas, thisNode, vol, emptyNode, applyChange)