[pbs-devel] [PATCH proxmox-backup 3/3] api: sync job: log stats for removed vanished entities

Christian Ebner c.ebner at proxmox.com
Fri Mar 8 14:01:50 CET 2024


Extend the current task log summary to include a log entry stating the
number of removed because vanished on the source side snapshots,
backup groups and namespaces.

The additional task log line states, e.g.:
> Summary: removed vanished: snapshots: 2, groups: 1, namespaces: 0

The log line is not shown if the sync jobs `remove_vanished` flag was
not set and therefore no removed vanished stats are present.

Suggested-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 src/api2/pull.rs | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/api2/pull.rs b/src/api2/pull.rs
index 29abc1c2..59db3660 100644
--- a/src/api2/pull.rs
+++ b/src/api2/pull.rs
@@ -161,6 +161,16 @@ pub fn do_sync_job(
                     task_log!(worker, "Summary: sync job found no new data to pull");
                 }
 
+                if let Some(removed) = pull_stats.removed {
+                    task_log!(
+                        worker,
+                        "Summary: removed vanished: snapshots: {}, groups: {}, namespaces: {}",
+                        removed.snapshots,
+                        removed.groups,
+                        removed.namespaces,
+                    );
+                }
+
                 task_log!(worker, "sync job '{}' end", &job_id);
 
                 Ok(())
-- 
2.39.2





More information about the pbs-devel mailing list