[pbs-devel] [PATCH proxmox-backup] file-restore: list: improve pxar v2 performance
Christian Ebner
c.ebner at proxmox.com
Mon Jun 10 10:39:33 CEST 2024
Do not attach the payload reader for split pxar archives, as only the
metadata has to be accessed for listing.
This avoids that the decoder performs consistency checks with the
payload stream, which require chunk download and decoding, making the
listing unusable slow.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
proxmox-file-restore/src/main.rs | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/proxmox-file-restore/src/main.rs b/proxmox-file-restore/src/main.rs
index a09873467..3dc2b3fd9 100644
--- a/proxmox-file-restore/src/main.rs
+++ b/proxmox-file-restore/src/main.rs
@@ -170,7 +170,7 @@ async fn list_files(
path = vec![b'/'];
}
- let (archive_name, payload_archive_name) =
+ let (archive_name, _payload_archive_name) =
pbs_client::tools::get_pxar_archive_names(&file, &manifest)?;
let (reader, archive_size) = get_remote_pxar_reader(
@@ -181,19 +181,8 @@ async fn list_files(
)
.await?;
- let reader = if let Some(payload_archive_name) = payload_archive_name {
- let (payload_reader, payload_size) = get_remote_pxar_reader(
- &payload_archive_name,
- client,
- &manifest,
- crypt_config,
- )
- .await?;
- pxar::PxarVariant::Split(reader, (payload_reader, payload_size))
- } else {
- pxar::PxarVariant::Unified(reader)
- };
-
+ // only care about the metadata, don't attach a payload reader
+ let reader = pxar::PxarVariant::Unified(reader);
let accessor = Accessor::new(reader, archive_size).await?;
let path = OsStr::from_bytes(&path);
--
2.39.2
More information about the pbs-devel
mailing list