]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tools/cephfs_mirror: Make max datasync threads configureable
authorKotresh HR <khiremat@redhat.com>
Wed, 14 Jan 2026 12:50:26 +0000 (18:20 +0530)
committerKotresh HR <khiremat@redhat.com>
Tue, 17 Feb 2026 20:10:50 +0000 (01:40 +0530)
Add a config to configure the number of data sync threads.

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

index f826161872b8800b81cc1028af5885588e7203a5..33817d70641f98bbb84f2e798b301a47589871ba 100644 (file)
@@ -5,13 +5,30 @@ options:
 - name: cephfs_mirror_max_concurrent_directory_syncs
   type: uint
   level: advanced
-  desc: maximum number of concurrent snapshot synchronization threads
-  long_desc: maximum number of directory snapshots that can be synchronized concurrently
-    by cephfs-mirror daemon. Controls the number of synchronization threads.
+  desc: maximum number of concurrent snapshot synchronization crawler threads
+  long_desc: maximum number of directory snapshots that can be crawled concurrently
+    by cephfs-mirror daemon. Controls the number of synchronization crawler threads.
+    Note that the crawler threads also does entry operations like directory creations,
+    file deletes and snapshot deletes/renames.
   default: 3
   services:
   - cephfs-mirror
   min: 1
+- name: cephfs_mirror_max_concurrent_data_sync_threads
+  type: uint
+  level: advanced
+  desc: maximum number of concurrent snapshot data synchronization threads
+  long_desc: maximum number of directory snapshots that can be synchronized concurrently
+    by the cephfs-mirror daemon. This setting controls the size of the data synchronization
+    thread pool. These threads concurrently synchronize files queued by the crawler thread
+    for each snapshot. Note that while the data thread pool processes files concurrently
+    from one snapshot at a time, the crawler thread pool can concurrently crawl and synchronize
+    entry operations across 'n' snapshots, where 'n' is the value configured in
+    cephfs_mirror_max_concurrent_directory_syncs.
+  default: 5
+  services:
+  - cephfs-mirror
+  min: 1
 - name: cephfs_mirror_action_update_interval
   type: secs
   level: advanced
index 3b701836a89f09c2b966994f22e0c7f088be99d2..8cb3d612bf67dfa39e18e579cdeed0805f6d1e1d 100644 (file)
@@ -299,14 +299,13 @@ int PeerReplayer::init() {
     m_replayers.push_back(std::move(replayer));
   }
 
-  //TODO: Have a separate tuneable for data sync threads
-  nr_replayers = g_ceph_context->_conf.get_val<uint64_t>(
-    "cephfs_mirror_max_concurrent_directory_syncs");
-  dout(20) << ": spawning " << nr_replayers << " snapshot data replayer(s)" << dendl;
-  while (nr_replayers-- > 0) {
+  auto nr_data_replayers = g_ceph_context->_conf.get_val<uint64_t>(
+    "cephfs_mirror_max_concurrent_data_sync_threads");
+  dout(20) << ": spawning " << nr_data_replayers << " snapshot data replayer(s)" << dendl;
+  while (nr_data_replayers-- > 0) {
     std::unique_ptr<SnapshotDataSyncThread> data_replayer(
       new SnapshotDataSyncThread(this));
-    std::string name("d_replayer-" + stringify(nr_replayers));
+    std::string name("d_replayer-" + stringify(nr_data_replayers));
     data_replayer->create(name.c_str());
     m_data_replayers.push_back(std::move(data_replayer));
   }