[pbs-devel] [PATCH v8 proxmox-backup 28/69] api: datastore: attach split archive payload chunk reader

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Jun 4 10:26:33 CEST 2024


On May 28, 2024 11:42 am, Christian Ebner wrote:
> Attach the payload chunk reader for pxar archives which have been
> uploaded using split streams for metadata and payload data.
> 
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
> changes since version 7:
> - no changes
> 
> changes since version 6:
> - adapt to PxarVariant pxar interface
> 
>  src/api2/admin/datastore.rs | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
> index af1c12cc0..bab1104d4 100644
> --- a/src/api2/admin/datastore.rs
> +++ b/src/api2/admin/datastore.rs
> @@ -1813,7 +1813,16 @@ pub fn pxar_file_download(
>          let (reader, archive_size) =
>              get_local_pxar_reader(datastore.clone(), &manifest, &backup_dir, pxar_name)?;
>  
> -        let decoder = Accessor::new(pxar::PxarVariant::Unified(reader), archive_size).await?;
> +        let reader = if let Some(archive_base_name) = pxar_name.strip_suffix(".mpxar.didx") {
> +            let payload_archive_name = format!("{archive_base_name}.ppxar.didx");
> +            let payload_input =
> +                get_local_pxar_reader(datastore, &manifest, &backup_dir, &payload_archive_name)?;
> +            pxar::PxarVariant::Split(reader, payload_input)
> +        } else {
> +            pxar::PxarVariant::Unified(reader)
> +        };
> +        let decoder = Accessor::new(reader, archive_size).await?;
> +

some of this is another variant of the get_pxar_archive_names helper, if
it lived in pbs-client it could maybe be re-used here?

>          let root = decoder.open_root().await?;
>          let path = OsStr::from_bytes(file_path).to_os_string();
>          let file = root
> -- 
> 2.39.2
> 
> 
> 
> _______________________________________________
> 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