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 BA93B1FF187 for ; Mon, 3 Nov 2025 15:51:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3E4322022E; Mon, 3 Nov 2025 15:51:46 +0100 (CET) Date: Mon, 03 Nov 2025 15:51:09 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20251103113120.239455-1-c.ebner@proxmox.com> <20251103113120.239455-13-c.ebner@proxmox.com> In-Reply-To: <20251103113120.239455-13-c.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1762178497.hexxi4sxhd.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762181455851 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.048 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 Subject: Re: [pbs-devel] [PATCH proxmox-backup 12/17] datastore: get per-chunk file lock for chunk rename on s3 backend X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On November 3, 2025 12:31 pm, Christian Ebner wrote: > To guarantee exclusive access during s3 object store and cache > operations, acquire the per-chunk file before renaming a chunk when > the datastore is backed by s3. > > This does not yet cover locking for the GC and chunk insert, part > of subsequent changes. > > Signed-off-by: Christian Ebner > --- > pbs-datastore/src/datastore.rs | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs > index e7ec87a7f..e65f3a60c 100644 > --- a/pbs-datastore/src/datastore.rs > +++ b/pbs-datastore/src/datastore.rs > @@ -2586,6 +2586,7 @@ impl DataStore { > let (path, digest_str) = self.chunk_path(digest); > > let _lock = self.inner.chunk_store.mutex().lock().unwrap(); > + let _chunk_guard = self.lock_chunk_for_backend(digest)?; lock inversion? when inserting into S3, the chunk lock is obtained first, and then the mutex is obtained for all insertions in chunk_store.insert_chunk while the chunk lock is held.. while we do have a long timeout here, that would still be quite bad.. > > let mut counter = 0; > let mut new_path = path.clone(); > -- > 2.47.3 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel > > > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel