[pbs-devel] [RFC v2 proxmox-backup 04/21] datastore: ignore trashed snapshots for last successful backup

Christian Ebner c.ebner at proxmox.com
Thu May 8 15:05:38 CEST 2025


Exclude trahed snapshots from looking up the last successful backup
of the group, as trashed items are marked for deletion by the next
garbage collection run and must be considered as if not present
anymore.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-datastore/src/backup_info.rs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
index a8c864ac8..189ed28ad 100644
--- a/pbs-datastore/src/backup_info.rs
+++ b/pbs-datastore/src/backup_info.rs
@@ -172,8 +172,13 @@ impl BackupGroup {
                     return Ok(());
                 }
 
-                let mut manifest_path = PathBuf::from(backup_time);
-                manifest_path.push(MANIFEST_BLOB_NAME.as_ref());
+                let path = PathBuf::from(backup_time);
+                let trash_marker_path = path.join(TRASH_MARKER_FILENAME);
+                if trash_marker_path.exists() {
+                    return Ok(());
+                }
+
+                let manifest_path = path.join(MANIFEST_BLOB_NAME.as_ref());
 
                 use nix::fcntl::{openat, OFlag};
                 match openat(
-- 
2.39.5





More information about the pbs-devel mailing list