[pbs-devel] [RFC v2 proxmox-backup 11/21] datastore: check for trash marker in namespace exists check
Christian Ebner
c.ebner at proxmox.com
Thu May 8 15:05:45 CEST 2025
Namespaces which have been marked as trash are not considered
existing. This makes sure that sync jobs or tape backup jobs try to
newly create the namespace, thereby clearing all pre-existing
contents in it.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
pbs-datastore/src/datastore.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index b1d81e199..ffc6a7039 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -567,7 +567,11 @@ impl DataStore {
pub fn namespace_exists(&self, ns: &BackupNamespace) -> bool {
let mut path = self.base_path();
path.push(ns.path());
- path.exists()
+ if !path.exists() {
+ return false;
+ }
+ path.push(TRASH_MARKER_FILENAME);
+ !path.exists()
}
/// Remove the namespace and all it's parent components from the trash by removing the trash or
--
2.39.5
More information about the pbs-devel
mailing list