[pbs-devel] [PATCH proxmox-backup 08/11] datastore: add manifest locking
Dietmar Maurer
dietmar at proxmox.com
Thu Oct 15 07:39:36 CEST 2020
Holding the lock for such long time seems wrong to me.
Instead, can we simple reload the manifest before we update
the verify_state?
> diff --git a/src/backup/verify.rs b/src/backup/verify.rs
> index 05b6ba86..839987e1 100644
> --- a/src/backup/verify.rs
> +++ b/src/backup/verify.rs
> @@ -300,8 +300,8 @@ pub fn verify_backup_dir(
> return Ok(true);
> }
>
> - let mut manifest = match datastore.load_manifest(&backup_dir) {
> - Ok((manifest, _)) => manifest,
> + let (mut manifest, manifest_guard) = match datastore.load_manifest_locked(&backup_dir) {
> + Ok((manifest, guard)) => (manifest, guard),
> Err(err) => {
> task_log!(
> worker,
> @@ -368,7 +368,7 @@ pub fn verify_backup_dir(
> upid,
> };
> manifest.unprotected["verify_state"] = serde_json::to_value(verify_state)?;
> - datastore.store_manifest(&backup_dir, manifest)
> + datastore.store_manifest(&backup_dir, manifest, manifest_guard)
> .map_err(|err| format_err!("unable to store manifest blob - {}", err))?;
>
> Ok(error_count == 0)
> --
> 2.20.1
>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
More information about the pbs-devel
mailing list