From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 5CB731FF138 for ; Wed, 04 Mar 2026 11:35:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EEC816FA4; Wed, 4 Mar 2026 11:36:45 +0100 (CET) From: Christian Ebner 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 Message-ID: <20260304103600.263896-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772620545240 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.013 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.668 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.322 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 1.141 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: Q2MLAXQLUYDIG2JGM2DRAQ374XH7PL7T X-Message-ID-Hash: Q2MLAXQLUYDIG2JGM2DRAQ374XH7PL7T X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- 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