public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] datastore: s3: use owner from local store cache instead of refetching
@ 2025-12-03 15:33 Christian Ebner
  0 siblings, 0 replies; only message in thread
From: Christian Ebner @ 2025-12-03 15:33 UTC (permalink / raw)
  To: pbs-devel

Currently the owner file is fetched from the s3 backend for each
backup group. This will however significantly increase the time
needed for listing backup contents and cause additional requests
which can be avoided. Simply use the local owner file instead.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
This was reported in an enterprise support ticket.

 pbs-datastore/src/datastore.rs | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index 36550ff63..9d36307ef 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -967,21 +967,6 @@ impl DataStore {
         backup_group: &pbs_api_types::BackupGroup,
     ) -> Result<Authid, Error> {
         let full_path = self.owner_path(ns, backup_group);
-
-        if let DatastoreBackend::S3(s3_client) = self.backend()? {
-            let mut path = ns.path();
-            path.push(backup_group.to_string());
-            let object_key = crate::s3::object_key_from_path(&path, GROUP_OWNER_FILE_NAME)
-                .context("invalid owner file object key")?;
-            let response = proxmox_async::runtime::block_on(s3_client.get_object(object_key))?
-                .ok_or_else(|| format_err!("fetching owner failed"))?;
-            let content = proxmox_async::runtime::block_on(response.content.collect())?;
-            let owner = String::from_utf8(content.to_bytes().trim_ascii_end().to_vec())?;
-            return owner
-                .parse()
-                .map_err(|err| format_err!("parsing owner for {backup_group} failed: {err}"));
-        }
-
         let owner = proxmox_sys::fs::file_read_firstline(full_path)?;
         owner
             .trim_end() // remove trailing newline
-- 
2.47.3



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-03 15:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-03 15:33 [pbs-devel] [PATCH proxmox-backup] datastore: s3: use owner from local store cache instead of refetching Christian Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal