From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 26DC81FF0E0 for ; Thu, 23 Jul 2026 13:52:16 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id D2C9E21488; Thu, 23 Jul 2026 13:52:15 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH proxmox-backup v3 09/10] api: config: unlocked s3 bucket access check for datastore creation From: Robert Obkircher To: Christian Ebner In-Reply-To: <20260721103643.333028-10-c.ebner@proxmox.com> References: <20260721103643.333028-1-c.ebner@proxmox.com> <20260721103643.333028-10-c.ebner@proxmox.com> Date: Thu, 23 Jul 2026 13:52:10 +0200 Message-Id: <178480753020.88450.9707249359570598383.b4-review@b4> X-Mailer: b4 0.16-dev X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784807503199 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.199 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: DURQVND2JDRZW6BMSRDZWGK3PWFSAZCX X-Message-ID-Hash: DURQVND2JDRZW6BMSRDZWGK3PWFSAZCX X-MailFrom: r.obkircher@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 CC: pbs-devel@lists.proxmox.com 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: > Instead of holding the lock for the whole datastore creation, use the > maintenance-mode `create`, protected by the maintenance-mode lock. > It is inserted and written to the config when setting the maintenance > mode before even starting any datastore related operation. Cleanup > from config if creation failed must be performed manually. > > This has the advantage that a potentially long running creation does > not block any concurrent access to the datastore config, thereby > blocking also any unrelated datastore. > > The config has to be re-parsed a second time for this, but given that > this unblocks the config and this is no performance critical path > that tradeoff is better than its alternative. By refactoring the > helpers to set and unset the maintenance mode, they can be reused for > all call sites. > > Rely on re-acquisition of the lock to also succeed if other operations > are being performed, due to the 10s timeout. > > Ordering of locking cannot always be preserved, but deadlocks are > excluded by timeouts. > > Signed-off-by: Christian Ebner >[..] > @@ -253,8 +253,27 @@ pub fn create_datastore_disk( > bail!("datastore '{}' already exists.", datastore.name); > } > > + let maintenance_mode_lock = > + pbs_datastore::maintenance_mode_lock(&datastore.name, &lock)?; > + crate::api2::helpers::set_maintenance_type( > + lock, > + &maintenance_mode_lock, > + &mut datastore, > + MaintenanceType::Create, > + )?; > + Isn't this too early to drop the config lock? For example the `datastore.ensure_not_nested(&existing_stores)` inside do_create_datastore could now potentially miss a newly created datastore. -- Robert Obkircher