aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_balance.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2024-11-06 08:09:22 +0500
committerGitHub <noreply@github.com>2024-11-05 19:09:22 -0800
commit9a5d3e7b315b8f3b0c7355d411952f260684cebd (patch)
tree49ae367f94744c4402a2ff3005b5bbf7808849fd /weed/shell/command_volume_balance.go
parent15fc58bfd99ee2ff01326d2f653c69d72db4f1f4 (diff)
downloadseaweedfs-9a5d3e7b315b8f3b0c7355d411952f260684cebd.tar.xz
seaweedfs-9a5d3e7b315b8f3b0c7355d411952f260684cebd.zip
[shell] add admin noLock for balance (#6209)
add admin noLock for balance
Diffstat (limited to 'weed/shell/command_volume_balance.go')
-rw-r--r--weed/shell/command_volume_balance.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index 42b4ea13c..8351415e2 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -76,14 +76,19 @@ 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")
+ noLock := balanceCommand.Bool("noLock", false, "do not lock the admin shell at one's own risk")
applyBalancing := balanceCommand.Bool("force", false, "apply the balancing plan.")
if err = balanceCommand.Parse(args); err != nil {
return nil
}
infoAboutSimulationMode(writer, *applyBalancing, "-force")
- if err = commandEnv.confirmIsLocked(args); err != nil {
- return
+ if *noLock {
+ commandEnv.noLock = true
+ } else {
+ if err = commandEnv.confirmIsLocked(args); err != nil {
+ return
+ }
}
// collect topology information