[pbs-devel] [PATCH proxmox-backup] garbage collection: allow to abort or shutdown on phase 2 for s3 stores
Christian Ebner
c.ebner at proxmox.com
Fri Nov 28 16:41:21 CET 2025
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 <c.ebner at proxmox.com>
---
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
More information about the pbs-devel
mailing list