[pbs-devel] [RFC v2 proxmox-backup 07/21] sync: ignore trashed groups in local source reader
Fabian Grünbichler
f.gruenbichler at proxmox.com
Fri May 9 14:27:39 CEST 2025
On May 8, 2025 3:05 pm, Christian Ebner wrote:
> Check and exclude backup groups which have been marked as trash from
> sync.
could be grouped with patch 5?
>
> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
> ---
> pbs-datastore/src/backup_info.rs | 7 +++++++
> src/server/sync.rs | 1 +
> 2 files changed, 8 insertions(+)
>
> diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs
> index 189ed28ad..b4fabb2cc 100644
> --- a/pbs-datastore/src/backup_info.rs
> +++ b/pbs-datastore/src/backup_info.rs
> @@ -105,6 +105,13 @@ impl BackupGroup {
> self.full_group_path().exists()
> }
>
> + /// Check if the group is currently marked as trash by checking the presence of the trash
> + /// marker file in the group's directory
> + pub fn is_trashed(&self) -> bool {
> + let path = self.full_group_path().join(TRASH_MARKER_FILENAME);
> + path.exists()
> + }
and this hunk moved to patch 2, or the is_trashed helpers extracted into
their own patch?
> +
> pub fn list_backups(&self, filter: ListBackupFilter) -> Result<Vec<BackupInfo>, Error> {
> let mut list = vec![];
>
> diff --git a/src/server/sync.rs b/src/server/sync.rs
> index 3de2ec9a4..ce338fbbe 100644
> --- a/src/server/sync.rs
> +++ b/src/server/sync.rs
> @@ -447,6 +447,7 @@ impl SyncSource for LocalSource {
> Some(owner),
> )?
> .filter_map(Result::ok)
> + .filter(|backup_group| !backup_group.is_trashed())
> .map(|backup_group| backup_group.group().clone())
> .collect::<Vec<pbs_api_types::BackupGroup>>())
> }
> --
> 2.39.5
>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
>
More information about the pbs-devel
mailing list