From d3b11da4f1bcdf1c0943a3daf497f1c083dd3b9e Mon Sep 17 00:00:00 2001 From: Aleksei Filatov <68555560+aalexfvk@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:53:14 +0300 Subject: [PATCH] Fix CREATED status if it is failed while uploading object storage disk metadata (#175) --- ch_backup/ch_backup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ch_backup/ch_backup.py b/ch_backup/ch_backup.py index 78367191..b425db47 100644 --- a/ch_backup/ch_backup.py +++ b/ch_backup/ch_backup.py @@ -186,6 +186,8 @@ def backup( ], ) + # Upload operations are async. Should wait until they are all finished. + self._context.backup_layout.wait() self._context.backup_meta.state = BackupState.CREATED except (Exception, TerminatingSignal) as e: logging.critical("Backup failed", exc_info=True) @@ -201,9 +203,6 @@ def backup( if not self._context.config.get("keep_freezed_data_on_failure"): self._context.ch_ctl.remove_freezed_data() - # Upload operations are asynch. Should wait until they are all finished. - self._context.backup_layout.wait() - return self._context.backup_meta.name, None # pylint: disable=too-many-arguments,duplicate-code