From a143c888e53d007e7089c71f2c2af7c35b86a55e Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:17:25 +0500 Subject: [PATCH] [shell] don't require lock when there are no changes for volume.fix.replication (#6266) * don't require lock when there are no changes * revert takeAction --- weed/shell/command_volume_fix_replication.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weed/shell/command_volume_fix_replication.go b/weed/shell/command_volume_fix_replication.go index 40bc07fce..61c4ac990 100644 --- a/weed/shell/command_volume_fix_replication.go +++ b/weed/shell/command_volume_fix_replication.go @@ -73,12 +73,13 @@ func (c *commandVolumeFixReplication) Do(args []string, commandEnv *CommandEnv, return nil } - if err = commandEnv.confirmIsLocked(args); err != nil { + commandEnv.noLock = *skipChange + takeAction := !*skipChange + + if err = commandEnv.confirmIsLocked(args); takeAction && err != nil { return } - takeAction := !*skipChange - underReplicatedVolumeIdsCount := 1 for underReplicatedVolumeIdsCount > 0 { fixedVolumeReplicas := map[string]int{}