From 476b4acadc203a7fdce54e466f071fb538f2982b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Wed, 10 Jun 2020 14:57:39 +0200 Subject: [PATCH] BackupEnvironment: do not set finished flag prematurely we check if all dynamic_writers are closed and if the backup contains any valid files, we can only mark the backup finished after those checks, else the backup task gets marked as OK, even though it is not finished and no cleanups run Signed-off-by: Dominik Csapak Signed-off-by: Wolfgang Bumiller --- 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 34d08333..16f21324 100644 --- a/src/api2/backup/environment.rs +++ b/src/api2/backup/environment.rs @@ -430,8 +430,6 @@ impl BackupEnvironment { state.ensure_unfinished()?; - state.finished = true; - if state.dynamic_writers.len() != 0 { bail!("found open index writer - unable to finish backup"); } @@ -440,6 +438,8 @@ impl BackupEnvironment { bail!("backup does not contain valid files (file count == 0)"); } + state.finished = true; + Ok(()) }