]> 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>
Wed, 4 Feb 2026 08:53:14 +0000 (14:23 +0530)
commitf5d6fcd9e997873205b63612d4fc47b92c10cb38
tree19b44e3db2909f4d76dbf49fdd41d33c49eabfbd
parent2ee74e511a7805fa68fa224573b5beee11fd3921
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