]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools/cephfs_mirror: Don't use blockdiff on smaller files
authorKotresh HR <khiremat@redhat.com>
Sun, 15 Feb 2026 09:37:09 +0000 (15:07 +0530)
committerKotresh HR <khiremat@redhat.com>
Mon, 16 Feb 2026 19:14:15 +0000 (00:44 +0530)
Use blockdiff only if the file size is greater than 16MiB

Fixes: https://tracker.ceph.com/issues/73452
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/tools/cephfs_mirror/PeerReplayer.cc

index c2d25be9a8b4f70e2f93234937faac1321256967..9ce6ed3288f8ffad708d6bb01882a75a9fbcd4d9 100644 (file)
@@ -1707,7 +1707,8 @@ int PeerReplayer::SnapDiffSync::get_changed_blocks(const std::string &epath,
   dout(20) << ": dir_root=" << m_dir_root << ", epath=" << epath
            << ", sync_check=" << sync_check << dendl;
 
-  if (!sync_check) {
+  static constexpr uint64_t MIN_BYTES_BLOCKDIFF = 1ULL * 16 * 1024 * 1024; // 16MiB
+  if (!sync_check || stx.stx_size <= MIN_BYTES_BLOCKDIFF) {
     return SyncMechanism::get_changed_blocks(epath, stx, sync_check, callback);
   }