Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RidRisR committed Aug 30, 2024
1 parent 52532e5 commit b8858d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions pkg/apis/pingcap/v1alpha1/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,7 @@ func GetLogSubcommandConditionInfo(backup *Backup) (reason, message string) {

// IsLogBackupAlreadyStart return whether log backup has already started.
func IsLogBackupAlreadyStart(backup *Backup) bool {
if backup.Spec.Mode != BackupModeLog || backup.Status.CommitTs == "" {
return false
}
return backup.Status.Phase == BackupRunning
return backup.Spec.Mode == BackupModeLog && backup.Status.CommitTs != ""
}

// IsLogBackupAlreadyTruncate return whether log backup has already truncated.
Expand Down Expand Up @@ -428,6 +425,6 @@ func IsLogBackupAlreadyPaused(backup *Backup) bool {
}

// IsLogBackupAlreadyRestart return whether log backup has already resumed.
func IsLogBackupAlreadyResumed(backup *Backup) bool {
func IsLogBackupAlreadyRunning(backup *Backup) bool {
return backup.Spec.Mode == BackupModeLog && backup.Status.Phase == BackupRunning
}
2 changes: 1 addition & 1 deletion pkg/backup/backup/backup_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ func (bm *backupManager) skipLogBackupSync(backup *v1alpha1.Backup) (bool, error
case v1alpha1.LogPauseCommand:
skip = v1alpha1.IsLogBackupAlreadyPaused(backup)
case v1alpha1.LogResumeCommand:
skip = !v1alpha1.IsLogBackupAlreadyResumed(backup)
skip = !v1alpha1.IsLogBackupAlreadyRunning(backup)
case v1alpha1.LogTruncateCommand:
if v1alpha1.IsLogBackupAlreadyTruncate(backup) {
skip = true
Expand Down

0 comments on commit b8858d2

Please sign in to comment.