File tree Expand file tree Collapse file tree 5 files changed +4
-34
lines changed
demand-backup-incremental-sharded
demand-backup-incremental
demand-backup-physical-sharded
pkg/controller/perconaservermongodbrestore Expand file tree Collapse file tree 5 files changed +4
-34
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ run_recovery_check() {
50
50
# we don't wait for cluster readiness here because the annotation gets removed then
51
51
wait_restore " ${backup_name} " " ${cluster} " " ready" " 0" " 3000"
52
52
53
- sleep 15
54
-
55
- if [ $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) == null ]; then
53
+ if [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) " == null ] && [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-in-progress"' ) " == null ]; then
56
54
log " psmdb/${cluster} should be annotated with percona.com/resync-pbm after a incremental restore"
57
55
exit 1
58
56
fi
Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ run_recovery_check() {
50
50
# we don't wait for cluster readiness here because the annotation gets removed then
51
51
wait_restore " ${backup_name} " " ${cluster} " " ready" " 0" " 1800"
52
52
53
- sleep 15
54
-
55
- if [ $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) == null ]; then
53
+ if [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) " == null ] && [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-in-progress"' ) " == null ]; then
56
54
log " psmdb/${cluster} should be annotated with percona.com/resync-pbm after a incremental restore"
57
55
exit 1
58
56
fi
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ run_recovery_check() {
37
37
# we don't wait for cluster readiness here because the annotation gets removed then
38
38
wait_restore " ${backup_name} " " ${cluster} " " ready" " 0" " 3000"
39
39
40
- sleep 15
41
-
42
- if [ $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) == null ]; then
40
+ if [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) " == null ] && [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-in-progress"' ) " == null ]; then
43
41
echo " psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore"
44
42
exit 1
45
43
fi
Original file line number Diff line number Diff line change @@ -37,9 +37,7 @@ run_recovery_check() {
37
37
# we don't wait for cluster readiness here because the annotation gets removed then
38
38
wait_restore " ${backup_name} " " ${cluster} " " ready" " 0" " 1800"
39
39
40
- sleep 15
41
-
42
- if [ $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) == null ]; then
40
+ if [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-pbm"' ) " == null ] && [ " $( kubectl_bin get psmdb ${cluster} -o yaml | yq ' .metadata.annotations."percona.com/resync-in-progress"' ) " == null ]; then
43
41
echo " psmdb/${cluster} should be annotated with percona.com/resync-pbm after a physical restore"
44
42
exit 1
45
43
fi
Original file line number Diff line number Diff line change @@ -420,28 +420,6 @@ func (r *ReconcilePerconaServerMongoDBRestore) finishPhysicalRestore(ctx context
420
420
return false , errors .Wrapf (err , "annotate psmdb/%s for PBM resync" , cluster .Name )
421
421
}
422
422
423
- err = retry .OnError (retry .DefaultBackoff , func (err error ) bool {
424
- return err != nil
425
- }, func () error {
426
- c := new (psmdbv1.PerconaServerMongoDB )
427
- if err := r .client .Get (ctx , client .ObjectKeyFromObject (cluster ), c ); err != nil {
428
- return err
429
- }
430
-
431
- if c .Annotations == nil {
432
- return errors .New ("annotation wasn't added" )
433
- }
434
-
435
- if v , ok := c .Annotations [psmdbv1 .AnnotationResyncPBM ]; ! ok || v != "true" {
436
- return errors .New ("annotation wasn't added 2" )
437
- }
438
-
439
- return nil
440
- })
441
- if err != nil {
442
- return false , errors .Wrap (err , "failed to check if annotation was added" )
443
- }
444
-
445
423
if err := r .updateMongodSts (ctx , cluster , func (sts * appsv1.StatefulSet ) error {
446
424
if sts .Annotations [psmdbv1 .AnnotationRestoreInProgress ] == "true" {
447
425
delete (sts .Annotations , psmdbv1 .AnnotationRestoreInProgress )
You can’t perform that action at this time.
0 commit comments