From f21f4a0b78756b0197634627d46fa376bc70644e Mon Sep 17 00:00:00 2001 From: RidRisR <79858083+RidRisR@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:02:34 +0200 Subject: [PATCH] before bm --- cmd/backup-manager/app/backup/manager.go | 4 ++++ pkg/apis/pingcap/v1alpha1/backup.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/cmd/backup-manager/app/backup/manager.go b/cmd/backup-manager/app/backup/manager.go index f5d30dcdb89..2db9fc24ccd 100644 --- a/cmd/backup-manager/app/backup/manager.go +++ b/cmd/backup-manager/app/backup/manager.go @@ -461,6 +461,10 @@ func (bm *Manager) performLogBackup(ctx context.Context, backup *v1alpha1.Backup resultStatus, reason, err = bm.stopLogBackup(ctx, backup) case string(v1alpha1.LogTruncateCommand): resultStatus, reason, err = bm.truncateLogBackup(ctx, backup) + case string(v1alpha1.LogResumeCommand): + klog.Errorf("Log resume command is not supported yet") + case string(v1alpha1.LogPauseCommand): + klog.Errorf("Log pause command is not supported yet") default: return fmt.Errorf("log backup %s unknown log subcommand %s", bm, bm.SubCommand) } diff --git a/pkg/apis/pingcap/v1alpha1/backup.go b/pkg/apis/pingcap/v1alpha1/backup.go index 937a52cf5bd..d041763a772 100644 --- a/pkg/apis/pingcap/v1alpha1/backup.go +++ b/pkg/apis/pingcap/v1alpha1/backup.go @@ -339,6 +339,9 @@ func ParseLogBackupSubcommand(backup *Backup) LogSubCommandType { } switch backup.Spec.LogSubcommand { case "log-start": + if IsLogBackupAlreadyStart(backup) { + return LogResumeCommand + } return LogStartCommand case "log-stop": return LogStopCommand