[pbs-devel] [PATCH v1 proxmox-backup] add benchmark flag to backup creation for proper cleanup when running a benchmark

Dietmar Maurer dietmar at proxmox.com
Thu Sep 10 07:48:34 CEST 2020


some comment:

@@ -118,10 +118,8 @@ async move {
     let (path, is_new, _snap_guard) = datastore.create_locked_backup_dir(&backup_dir)?;
     if !is_new { bail!("backup directory already exists."); }
     let absolute_backup_dir_path = format!("{}/{}", &datastore.base_path().to_str().unwrap(), backup_group);
-    let mut worker_type = "backup";
-    if benchmark {
-        worker_type = "benchmark";
-    }
+    let worker_type = if benchmark { "benchmark" } else { "backup" };
+
     WorkerTask::spawn(worker_type, Some(worker_id), userid.clone(), true, move |worker| {
         let mut env = BackupEnvironment::new(
             env_type, userid, worker.clone(), datastore, backup_dir);


On 09/02/2020 11:41 AM Hannes Laimer <h.laimer at proxmox.com> wrote:
> 
>  
> Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
> ---
> v1:
> 	- set worker_type to 'benchmark', if it is one
> 	- delete whole '<datastore>/host/benchmark'-folder after benchmark

This is super dangerous, because you delete the whole group now, i.e: you
can do the following

run job /vm/12345 --benchmark

which completely removes all you VM backups?!





More information about the pbs-devel mailing list