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 DBB611FF15C for ; Fri, 28 Nov 2025 16:41:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6B4591E508; Fri, 28 Nov 2025 16:41:34 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Fri, 28 Nov 2025 16:41:21 +0100 Message-ID: <20251128154121.688870-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1764344451850 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: [pbs-devel] [PATCH proxmox-backup] garbage collection: allow to abort or shutdown on phase 2 for s3 stores 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" Currently only phase 1 and phase 3 can be aborted on s3 backed datastores. Safely abort phase 2 after each processed s3 object key. Doing that after each key is possible since the chunk is already cleaned up from the local datastore cache after each iteration. While it might not have been cleaned up from the s3 backend, this leaves it in the same state as if after a datastore re-creation from previous S3 contents, where the local marker is also not present. So either the chunk will be cleaned up by the subsequent garbage collection run or overwritten by reupload and marker file re-insertion if a concurrent backup writer adds it again in the meantime. Signed-off-by: Christian Ebner --- Noted that it currently cannot be aborted while working on a status progress for phase 2 as well. pbs-datastore/src/datastore.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs index 36550ff63..72999be56 100644 --- a/pbs-datastore/src/datastore.rs +++ b/pbs-datastore/src/datastore.rs @@ -1740,6 +1740,8 @@ impl DataStore { loop { for content in list_bucket_result.contents { + worker.check_abort()?; + worker.fail_on_shutdown()?; let (chunk_path, digest, bad) = match self.chunk_path_from_object_key(&content.key) { Some(path) => path, -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel