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 A874F1FF142 for ; Tue, 05 May 2026 10:12:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 721BC19865; Tue, 5 May 2026 10:12:07 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 0/4] don't hold datastore config lock during s3-refresh Date: Tue, 5 May 2026 10:11:32 +0200 Message-ID: <20260505081137.227901-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: 1777968613237 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [datastore.rs,proxmox.com,lib.rs] Message-ID-Hash: ZVSS4M6JJ4NDJLK7FDCPEX2PUWW5MNGS X-Message-ID-Hash: ZVSS4M6JJ4NDJLK7FDCPEX2PUWW5MNGS 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: Currently an s3-refresh runs while holding the datastore config lock, with the intention to block from accidentail leaving the corresponding maintenance mode, assuring consistency. However, this also blocks config access by all unrelated datastores, similar to mount/unmount for removable datastores, but for s3-refresh this is not acceptable since it can take significantly more time or block on network issues until timeouts are reached. Instead, implement per-datastore locks for maintenance-mode changes, and rely on these to block unexpected maintenance-mode changes. The first 3 patches are code style and refactoring only, the last patch actually introduces the maintenance-mode locks. Reported in the community forum: https://forum.proxmox.com/threads/183244/ Christian Ebner (4): pbs-config: reorganize crate use statements datastore: move lock files base path constant to central location datastore: move file lock helper to centralized place api/datastore: use maintenance-mode lock to protect against changes pbs-config/src/lib.rs | 18 +++++++------ pbs-datastore/src/backup_info.rs | 36 ++----------------------- pbs-datastore/src/chunk_store.rs | 5 ++-- pbs-datastore/src/datastore.rs | 2 ++ pbs-datastore/src/lib.rs | 45 +++++++++++++++++++++++++++++++ pbs-datastore/src/move_journal.rs | 2 +- src/api2/admin/datastore.rs | 26 +++++++++++++----- src/api2/config/datastore.rs | 6 ++++- 8 files changed, 87 insertions(+), 53 deletions(-) -- 2.47.3