From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 741DA1FF13C for ; Thu, 05 Mar 2026 09:59:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5CDD61DA54; Thu, 5 Mar 2026 10:00:26 +0100 (CET) Date: Thu, 05 Mar 2026 09:59:47 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= Subject: Re: [PATCH proxmox-backup] datastore: don't skip empty namespaces on s3 refresh To: Hannes Laimer , pbs-devel@lists.proxmox.com References: <20260304103938.42167-1-h.laimer@proxmox.com> In-Reply-To: <20260304103938.42167-1-h.laimer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1772700882.3w2c1gwglr.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1772701164231 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.003 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.018 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.703 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.386 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: 5X5QIU4L7UNC7RJYTV6GJ6ARFSALMXVJ X-Message-ID-Hash: 5X5QIU4L7UNC7RJYTV6GJ6ARFSALMXVJ X-MailFrom: f.gruenbichler@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: On March 4, 2026 11:39 am, Hannes Laimer wrote: > Without this empty namespaces present on s3 won't be visible locally. >=20 > Signed-off-by: Hannes Laimer > --- > pbs-datastore/src/datastore.rs | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore= .rs > index 7ad3d917..4749319a 100644 > --- a/pbs-datastore/src/datastore.rs > +++ b/pbs-datastore/src/datastore.rs > @@ -2535,6 +2535,15 @@ impl DataStore { > format!("failed to strip store context prefix {store= _prefix} for {object_key}") > })?; > if object_path.ends_with(NAMESPACE_MARKER_FILENAME) { > + // Ensure the marker's parent directory exists so th= e namespace is visible locally > + let ns_dir =3D tmp_base.join(object_path); > + if let Some(parent) =3D ns_dir.parent() { > + proxmox_sys::fs::create_path( > + parent, > + Some(dir_create_options), > + Some(dir_create_options), > + )?; > + } this is exactly the same code that is done a few lines below (modulo naming of the variable), could we just move this if with the continue and the `info!` statement below it a few lines down and have the same effect? diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.r= s index 7ad3d917d..ce09a72f1 100644 --- a/pbs-datastore/src/datastore.rs +++ b/pbs-datastore/src/datastore.rs @@ -2534,21 +2534,23 @@ impl DataStore { let object_path =3D object_path.strip_prefix(&store_prefix= ).with_context(|| { format!("failed to strip store context prefix {store_p= refix} for {object_key}") })?; - if object_path.ends_with(NAMESPACE_MARKER_FILENAME) { - continue; - } - - info!("Fetching object {object_path}"); =20 let file_path =3D tmp_base.join(object_path); if let Some(parent) =3D file_path.parent() { proxmox_sys::fs::create_path( parent, Some(dir_create_options), Some(dir_create_options), )?; } =20 + if object_path.ends_with(NAMESPACE_MARKER_FILENAME) { + // namespace created above even if empty + continue; + } + + info!("Fetching object {object_path}"); + let mut target_file =3D tokio::fs::OpenOptions::new() .write(true) .create(true) > continue; > } > =20 > --=20 > 2.47.3 >=20 >=20 >=20 >=20 >=20 >=20