all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] datastore: s3: use owner from local store cache instead of refetching
Date: Wed,  3 Dec 2025 16:33:10 +0100	[thread overview]
Message-ID: <20251203153310.598722-1-c.ebner@proxmox.com> (raw)

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


                 reply	other threads:[~2025-12-03 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251203153310.598722-1-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal