@@ -289,7 +289,7 @@ func (r *ReconcilePerconaServerMongoDBRestore) reconcilePhysicalRestore(
289
289
finished , err := r .finishPhysicalRestore (ctx , cluster )
290
290
if err != nil {
291
291
log .Error (err , "Failed to recover the cluster after the restore" )
292
- status .State = psmdbv1 .RestoreStateReady
292
+ // status.State = psmdbv1.RestoreStateReady
293
293
return status , nil
294
294
}
295
295
if ! finished {
@@ -400,6 +400,7 @@ func (r *ReconcilePerconaServerMongoDBRestore) finishPhysicalRestore(ctx context
400
400
return false , nil
401
401
}
402
402
403
+ resyncPresent := false
403
404
if err = retry .RetryOnConflict (retry .DefaultBackoff , func () error {
404
405
c := new (psmdbv1.PerconaServerMongoDB )
405
406
if err := r .client .Get (ctx , client .ObjectKeyFromObject (cluster ), c ); err != nil {
@@ -409,12 +410,20 @@ func (r *ReconcilePerconaServerMongoDBRestore) finishPhysicalRestore(ctx context
409
410
if c .Annotations == nil {
410
411
c .Annotations = make (map [string ]string )
411
412
}
413
+ if c .Annotations [psmdbv1 .AnnotationResyncPBM ] == "true" {
414
+ resyncPresent = true
415
+ return nil
416
+ }
417
+
412
418
c .Annotations [psmdbv1 .AnnotationResyncPBM ] = "true"
413
419
414
420
return r .client .Update (ctx , c )
415
421
}); err != nil {
416
422
return false , errors .Wrapf (err , "annotate psmdb/%s for PBM resync" , cluster .Name )
417
423
}
424
+ if ! resyncPresent {
425
+ return false , nil
426
+ }
418
427
419
428
if err := r .updateMongodSts (ctx , cluster , func (sts * appsv1.StatefulSet ) error {
420
429
if sts .Annotations [psmdbv1 .AnnotationRestoreInProgress ] == "true" {
0 commit comments