From d74edc3d89ed8fcb7ffd84c53e7395ffab1afef5 Mon Sep 17 00:00:00 2001 From: Stefan Reiter Date: Tue, 4 Aug 2020 12:41:59 +0200 Subject: [PATCH] finish_backup: mark backup as finished only after checks have passed Commit 9fa55e09 "finish_backup: test/verify manifest at server side" moved the finished-marking above some checks, which means if those fail the backup would still be marked as successful on the server. Revert that part and comment the line for the future. Signed-off-by: Stefan Reiter --- src/api2/backup/environment.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api2/backup/environment.rs b/src/api2/backup/environment.rs index 02aa0c40..bc780d20 100644 --- a/src/api2/backup/environment.rs +++ b/src/api2/backup/environment.rs @@ -477,8 +477,6 @@ impl BackupEnvironment { bail!("backup does not contain valid files (file count == 0)"); } - state.finished = true; - // check manifest let mut manifest = self.datastore.load_manifest_json(&self.backup_dir) .map_err(|err| format_err!("unable to load manifest blob - {}", err))?; @@ -500,6 +498,8 @@ impl BackupEnvironment { } } + // marks the backup as successful + state.finished = true; Ok(()) }