Skip to content

Commit

Permalink
Merge branch 'master' into fix-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Aug 22, 2023
2 parents df79995 + cb6b246 commit 24e67fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cmd/backup-manager/app/restore/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ func (rm *Manager) performRestore(ctx context.Context, restore *v1alpha1.Restore
restoreType = v1alpha1.RestoreVolumeComplete
} else {
restoreType = v1alpha1.RestoreDataComplete
allFinished = true
}
default:
ts, err := util.GetCommitTsFromBRMetaData(ctx, restore.Spec.StorageProvider)
Expand All @@ -314,8 +313,10 @@ func (rm *Manager) performRestore(ctx context.Context, restore *v1alpha1.Restore
}

updateStatus := &controller.RestoreUpdateStatus{
TimeStarted: &metav1.Time{Time: started},
CommitTs: commitTS,
CommitTs: commitTS,
}
if restore.Status.TimeStarted.Unix() <= 0 {
updateStatus.TimeStarted = &metav1.Time{Time: started}
}
if allFinished {
updateStatus.TimeCompleted = &metav1.Time{Time: time.Now()}
Expand Down
5 changes: 4 additions & 1 deletion pkg/backup/restore/restore_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,10 +513,13 @@ func (rm *restoreManager) volumeSnapshotRestore(r *v1alpha1.Restore, tc *v1alpha
}

// restore TidbCluster completed
newStatus := &controller.RestoreUpdateStatus{
TimeCompleted: &metav1.Time{Time: time.Now()},
}
if err := rm.statusUpdater.Update(r, &v1alpha1.RestoreCondition{
Type: v1alpha1.RestoreComplete,
Status: corev1.ConditionTrue,
}, nil); err != nil {
}, newStatus); err != nil {
return "UpdateRestoreCompleteFailed", err
}
return "", nil
Expand Down

0 comments on commit 24e67fa

Please sign in to comment.