[pbs-devel] [PATCH proxmox-backup 2/2] sync: pull: simplify logic for source snapshot filtering

Christian Ebner c.ebner at proxmox.com
Mon Nov 4 13:56:14 CET 2024


Decouple the actual filter logic from the skip reason output logic by
pulling the latter out of the filter closue.

Makes the filtering logic more intuitive.

Reviewed-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 1:
- no changes

 src/server/pull.rs | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/server/pull.rs b/src/server/pull.rs
index 8d8461cb2..0afb16bc0 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -533,23 +533,26 @@ async fn pull_group(
             if last_sync_time > dir.time {
                 already_synced_skip_info.update(dir.time);
                 return false;
-            } else if already_synced_skip_info.count > 0 {
-                info!("{already_synced_skip_info}");
-                already_synced_skip_info.reset();
             }
 
             if pos < cutoff && last_sync_time != dir.time {
                 transfer_last_skip_info.update(dir.time);
                 return false;
-            } else if transfer_last_skip_info.count > 0 {
-                info!("{transfer_last_skip_info}");
-                transfer_last_skip_info.reset();
             }
             true
         })
         .map(|(_, dir)| dir)
         .collect();
 
+    if already_synced_skip_info.count > 0 {
+        info!("{already_synced_skip_info}");
+        already_synced_skip_info.reset();
+    }
+    if transfer_last_skip_info.count > 0 {
+        info!("{transfer_last_skip_info}");
+        transfer_last_skip_info.reset();
+    }
+
     // start with 65536 chunks (up to 256 GiB)
     let downloaded_chunks = Arc::new(Mutex::new(HashSet::with_capacity(1024 * 64)));
 
-- 
2.39.5





More information about the pbs-devel mailing list