File tree Expand file tree Collapse file tree 3 files changed +9
-27
lines changed Expand file tree Collapse file tree 3 files changed +9
-27
lines changed Original file line number Diff line number Diff line change @@ -1460,11 +1460,10 @@ get_latest_restorable_time() {
1460
1460
# "pbm-agent status" can return different timestamp in first few seconds
1461
1461
# we need to get it twice to be sure that timestamp was not changed
1462
1462
until [[ $first_timestamp != " " && $first_timestamp != " null" && $first_timestamp == $second_timestamp ]]; do
1463
+ first_timestamp=$( kubectl_bin exec " $cluster -0" -c backup-agent -- pbm status -o json | jq ' .backups.pitrChunks.pitrChunks | last | .range.end' )
1463
1464
sleep 5
1464
1465
if [[ $first_timestamp != " " && $first_timestamp != " null" ]]; then
1465
1466
second_timestamp=$( kubectl_bin exec " $cluster -0" -c backup-agent -- pbm status -o json | jq ' .backups.pitrChunks.pitrChunks | last | .range.end' )
1466
- else
1467
- first_timestamp=$( kubectl_bin exec " $cluster -0" -c backup-agent -- pbm status -o json | jq ' .backups.pitrChunks.pitrChunks | last | .range.end' )
1468
1467
fi
1469
1468
let retry+=1
1470
1469
if [[ $retry -gt 30 ]]; then
Original file line number Diff line number Diff line change @@ -93,30 +93,6 @@ check_recovery() {
93
93
compare_mongo_cmd " find" " myApp:myPass@$cluster -2.$cluster .$namespace " " $cmp_postfix "
94
94
}
95
95
96
- get_latest_restorable_time () {
97
- local cluster=$1
98
- local timestamp
99
-
100
- timestamp=$( kubectl exec " $cluster -0" -c backup-agent -- pbm status -o json | jq ' .backups.pitrChunks.pitrChunks | last | .range.end' )
101
-
102
- $date -u -d @" $timestamp " " +%Y-%m-%dT%H:%M:%SZ"
103
- }
104
-
105
- compare_latest_restorable_time () {
106
- local cluster=$1
107
- local backup_name=$2
108
- local latest_restorable_time
109
- latest_restorable_time=$( get_latest_restorable_time " $cluster " )
110
- local backup_time
111
- backup_time=$( kubectl get psmdb-backup " $backup_name " -o jsonpath=' {.status.latestRestorableTime}' )
112
-
113
- if [[ $latest_restorable_time != " $backup_time " ]]; then
114
- echo " Error: latestRestorableTime is not equal to the latest timestamp of the backup $backup_name : $latest_restorable_time != $backup_time "
115
- exit 1
116
- fi
117
-
118
- }
119
-
120
96
main () {
121
97
create_infra $namespace
122
98
deploy_minio
Original file line number Diff line number Diff line change @@ -389,9 +389,16 @@ func NotJobLock(j Job) LockHeaderPredicate {
389
389
func (b * pbmC ) HasLocks (ctx context.Context , predicates ... LockHeaderPredicate ) (bool , error ) {
390
390
locks , err := lock .GetLocks (ctx , b .Client , & lock.LockHeader {})
391
391
if err != nil {
392
- return false , errors .Wrap (err , "getting lock data" )
392
+ return false , errors .Wrap (err , "get lock data" )
393
393
}
394
394
395
+ opLocks , err := lock .GetOpLocks (ctx , b .Client , & lock.LockHeader {})
396
+ if err != nil {
397
+ return false , errors .Wrap (err , "get op lock data" )
398
+ }
399
+
400
+ locks = append (locks , opLocks ... )
401
+
395
402
allowedByAllPredicates := func (l lock.LockHeader ) bool {
396
403
for _ , allow := range predicates {
397
404
if ! allow (l ) {
You can’t perform that action at this time.
0 commit comments