Skip to content

Commit

Permalink
fix: skip updating the status if the backup has already been complete…
Browse files Browse the repository at this point in the history
…d or has failed

ref: longhorn/longhorn 9168

Signed-off-by: Jack Lin <jack.lin@suse.com>
(cherry picked from commit ecfa3c2)
  • Loading branch information
ChanYiLin authored and derekbit committed Sep 5, 2024
1 parent 6b53654 commit c957fcb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/replica/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func (rb *BackupStatus) UpdateBackupStatus(snapID, volumeID string, state string
return fmt.Errorf("invalid volume [%s] and snapshot [%s], not volume [%s], snapshot [%s]", rb.volumeID, rb.SnapshotID, volumeID, id)
}

if rb.State == ProgressStateComplete || rb.State == ProgressStateError {
logrus.Warnf("backup of volume [%s] and snapshot [%s] already completed or failed, skip the status update", rb.volumeID, rb.SnapshotID)
return nil
}

rb.State = ProgressState(state)
rb.Progress = progress
rb.BackupURL = url
Expand Down

0 comments on commit c957fcb

Please sign in to comment.