diff --git a/cmd/pbm-agent/backup.go b/cmd/pbm-agent/backup.go index d896fc318..d677287da 100644 --- a/cmd/pbm-agent/backup.go +++ b/cmd/pbm-agent/backup.go @@ -54,16 +54,6 @@ func (a *Agent) Backup(ctx context.Context, cmd *ctrl.BackupCmd, opid ctrl.OPID, l := logger.NewEvent(string(ctrl.CmdBackup), cmd.Name, opid.String(), ep.TS()) ctx = log.SetLogEventToContext(ctx, l) - moveOn, err := a.startBcpLockCheck(ctx) - if err != nil { - l.Error("start backup lock check: %v", err) - return - } - if !moveOn { - l.Error("unable to proceed with the backup, active lock is present") - return - } - nodeInfo, err := topo.GetNodeInfoExt(ctx, a.nodeConn) if err != nil { l.Error("get node info: %v", err) @@ -76,6 +66,18 @@ func (a *Agent) Backup(ctx context.Context, cmd *ctrl.BackupCmd, opid ctrl.OPID, isClusterLeader := nodeInfo.IsClusterLeader() + if isClusterLeader { + moveOn, err := a.startBcpLockCheck(ctx) + if err != nil { + l.Error("start backup lock check: %v", err) + return + } + if !moveOn { + l.Error("unable to proceed with the backup, active lock is present") + return + } + } + canRunBackup, err := topo.NodeSuitsExt(ctx, a.nodeConn, nodeInfo, cmd.Type) if err != nil { l.Error("node check: %v", err)