Skip to content

Commit

Permalink
controller: Check backup volume sync time before activation
Browse files Browse the repository at this point in the history
Longhorn 7946

Signed-off-by: Shuo Wu <[email protected]>
  • Loading branch information
shuo-wu committed Feb 26, 2024
1 parent 917762a commit 401fc13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions controller/volume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3184,6 +3184,11 @@ func (c *VolumeController) checkAndFinishVolumeRestore(v *longhorn.Volume, e *lo
return err
}
if bv != nil {
if !bv.Status.LastSyncedAt.IsZero() &&
bv.Spec.SyncRequestedAt.After(bv.Status.LastSyncedAt.Time) {
log.Infof("Restore/DR volume needs to wait for backup volume %s update", bvName)
return nil
}
if bv.Status.LastBackupName != "" {
// If the backup CR does not exist, the Longhorn system may be still syncing up the info with the remote backup target.
// If the backup is removed already, the backup volume should receive the notification and update bv.Status.LastBackupName.
Expand Down

0 comments on commit 401fc13

Please sign in to comment.