]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
tools/cephfs_mirror: Efficient use of data sync threads
authorKotresh HR <khiremat@redhat.com>
Wed, 14 Jan 2026 13:07:13 +0000 (18:37 +0530)
committerKotresh HR <khiremat@redhat.com>
Tue, 17 Feb 2026 20:10:50 +0000 (01:40 +0530)
commit99ec86f6a7cce5d52530d38e853201bfb3bc8c75
tree233d95a8cb6e3acbd9ba0eeedd4bbd2f95f9c6ba
parent8363657b4910bd04cf4ab9e39ee0b991be117e9c
tools/cephfs_mirror: Efficient use of data sync threads

The job queue is something like below for data sync threads.

  |syncm1|---------|syncm2|------...---|syncmn|
     |                |                   |
   |m_sync_dataq|   |m_sync_dataq|    |m_sync_dataq|

There is global queue of SyncMechanism objects(syncm). Each syncm
object represents a single snapshot being synced and each syncm
object owns m_sync_dataq representing list of files in the snapshot
to be synced.

The data sync threads should consume the next syncm job
if the present syncm has no pending work. This can evidently
happen if the last file being synced in the present syncm
job is a large file from it's syncm_dataq. In this case, one
data sync thread is busy syncing the large file, the rest of
data sync threads just wait for it to finish to avoid busy loop.
Instead, the idle data sync threads could start consuming the next
syncm job.

This brings in a change to data structure.
 - syncm_q has to be std::deque instead of std::queue as syncm in the
   middle can finish syncing first and that needs to be removed before
   the front

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