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: [PATCH proxmox-backup] chunk store: s3: mute warning on overwrite empty chunk in local cache
Date: Wed,  4 Mar 2026 11:36:00 +0100	[thread overview]
Message-ID: <20260304103600.263896-1-c.ebner@proxmox.com> (raw)

For regular datastores overwriting chunks which have 0 size is
unexpected and cannot happen under regular operation. For datastores
backed by an S3 object storage, this is however expected as regular
operation if the cache reaches its capacity, since chunks get evicted
from the cache by leaving an empty file as chunk marker behind.

While the warning is benign, it causes false alerts in the task logs.
Therefore, silence the warning if the chunk insert overwriting the
file happens via the local datastore cache.

Fixes: https://forum.proxmox.com/threads/181330/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 pbs-datastore/src/chunk_store.rs               | 7 +++++--
 pbs-datastore/src/local_datastore_lru_cache.rs | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs
index bd1dc353b..773167a6d 100644
--- a/pbs-datastore/src/chunk_store.rs
+++ b/pbs-datastore/src/chunk_store.rs
@@ -667,7 +667,7 @@ impl ChunkStore {
         let _lock = self.mutex.lock();
 
         // Safety: lock acquired above
-        unsafe { self.insert_chunk_nolock(chunk, digest) }
+        unsafe { self.insert_chunk_nolock(chunk, digest, true) }
     }
 
     /// Safety: requires holding the chunk store mutex!
@@ -675,6 +675,7 @@ impl ChunkStore {
         &self,
         chunk: &DataBlob,
         digest: &[u8; 32],
+        warn_on_overwrite_empty: bool,
     ) -> Result<(bool, u64), Error> {
         // unwrap: only `None` in unit tests
         assert!(self.locker.is_some());
@@ -695,7 +696,9 @@ impl ChunkStore {
                 self.touch_chunk_no_lock(digest)?;
                 return Ok((true, old_size));
             } else if old_size == 0 {
-                log::warn!("found empty chunk '{digest_str}' in store {name}, overwriting");
+                if warn_on_overwrite_empty {
+                    log::warn!("found empty chunk '{digest_str}' in store {name}, overwriting");
+                }
             } else if chunk.is_encrypted() {
                 // incoming chunk is encrypted, possible attack or hash collision!
                 let mut existing_file = std::fs::File::open(&chunk_path)?;
diff --git a/pbs-datastore/src/local_datastore_lru_cache.rs b/pbs-datastore/src/local_datastore_lru_cache.rs
index f39b26ebb..ac27d4637 100644
--- a/pbs-datastore/src/local_datastore_lru_cache.rs
+++ b/pbs-datastore/src/local_datastore_lru_cache.rs
@@ -38,7 +38,7 @@ impl LocalDatastoreLruCache {
 
         // Safety: lock acquire above
         unsafe {
-            self.store.insert_chunk_nolock(chunk, digest)?;
+            self.store.insert_chunk_nolock(chunk, digest, false)?;
         }
         self.cache.insert(*digest, (), |digest| {
             // Safety: lock acquired above, this is executed inline!
-- 
2.47.3





                 reply	other threads:[~2026-03-04 10:35 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=20260304103600.263896-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