diff options
| author | ftong2020 <64820810+ftong2020@users.noreply.github.com> | 2025-01-13 15:30:18 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-12 23:30:18 -0800 |
| commit | e7f2936dcce21e8944501dbae01f8fd54fbf479a (patch) | |
| tree | 18db8c9e6da5732f119ec61f969ded1b2121d6e3 /weed/shell/command_volume_balance.go | |
| parent | da2a234b0040bcc59e31c3a851006e45efc9ff32 (diff) | |
| download | seaweedfs-e7f2936dcce21e8944501dbae01f8fd54fbf479a.tar.xz seaweedfs-e7f2936dcce21e8944501dbae01f8fd54fbf479a.zip | |
fix force arg dropped during volume balance command (#6432)
Diffstat (limited to 'weed/shell/command_volume_balance.go')
| -rw-r--r-- | weed/shell/command_volume_balance.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go index 48825c616..ac7dab3d9 100644 --- a/weed/shell/command_volume_balance.go +++ b/weed/shell/command_volume_balance.go @@ -9,11 +9,12 @@ import ( "strings" "time" + "slices" + "github.com/seaweedfs/seaweedfs/weed/pb" "github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding" "github.com/seaweedfs/seaweedfs/weed/storage/super_block" "github.com/seaweedfs/seaweedfs/weed/storage/types" - "slices" "github.com/seaweedfs/seaweedfs/weed/pb/master_pb" "github.com/seaweedfs/seaweedfs/weed/storage/needle" @@ -80,12 +81,15 @@ func (c *commandVolumeBalance) Do(args []string, commandEnv *CommandEnv, writer dc := balanceCommand.String("dataCenter", "", "only apply the balancing for this dataCenter") racks := balanceCommand.String("racks", "", "only apply the balancing for this racks") nodes := balanceCommand.String("nodes", "", "only apply the balancing for this nodes") - c.writable = *(balanceCommand.Bool("writable", false, "only apply the balancing for writable volumes")) + writable := balanceCommand.Bool("writable", false, "only apply the balancing for writable volumes") noLock := balanceCommand.Bool("noLock", false, "do not lock the admin shell at one's own risk") - c.applyBalancing = *(balanceCommand.Bool("force", false, "apply the balancing plan.")) + applyBalancing := balanceCommand.Bool("force", false, "apply the balancing plan.") if err = balanceCommand.Parse(args); err != nil { return nil } + c.writable = *writable + c.applyBalancing = *applyBalancing + infoAboutSimulationMode(writer, c.applyBalancing, "-force") if *noLock { |
