Skip to content

Commit

Permalink
PBM backup retry on resync operaion
Browse files Browse the repository at this point in the history
  • Loading branch information
olexandr-havryliak committed Apr 4, 2024
1 parent 4590eea commit 78e70a3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pbm-functional/pytest/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,20 @@ def make_backup(self, type):
Cluster.log("Current operation: " + str(running))
if not running:
if type:
start = n.check_output(
start = n.run(
'pbm backup --out=json --type=' + type)
else:
start = n.check_output('pbm backup --out=json')
name = json.loads(start)['name']
Cluster.log("Backup started")
break
start = n.run('pbm backup --out=json')
if start.rc == 0:
name = json.loads(start.stdout)['name']
Cluster.log("Backup started")
break
elif "resync" in start.stdout:
Cluster.log("Resync in progress, retrying: " + start.stdout)
else:
assert False, "Backup failed" + start.stdout + start.stderr
if time.time() > timeout:
assert False
assert False, "Timeout for backup start exceeded"
time.sleep(1)
timeout = time.time() + 900
while True:
Expand Down

0 comments on commit 78e70a3

Please sign in to comment.