]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tools/cephfs_mirror: Fix sync hang
authorKotresh HR <khiremat@redhat.com>
Tue, 31 Mar 2026 07:04:27 +0000 (12:34 +0530)
committerKotresh HR <khiremat@redhat.com>
Sat, 18 Apr 2026 12:38:40 +0000 (18:08 +0530)
commit66827323fcb4e5cf419afa03dbaefcd198774058
tree197921cb846bd2dec7bdea0eb75cf424c9a326a2
parentcfec561b2da9632ff1f7ce54f505fe0d368c231f
tools/cephfs_mirror: Fix sync hang

The snapshot mirror sync can hang if all of the following
are true.
 1. The snapshot being synced contain only directories and
    no files.
 2. The crawler finishes syncing dirs and completes crawling
    before datasync threads picks it up from syncm queue.

The above scenario can be achieved as below.

 1. Configure say /d0 and /d1 for mirroring.
 2. Create around 10k files in /d0
 3. Create a single dir say /d1/dir0
 4. snapshot /d0 and wait for status to change 'syncing'
 5. Now, snapshot /d1.

The /d1 snapshot will be stuck in syncing, as datasync
thread's has_pending_work logic would never pick it up
as there are no files to be synced (i.e. dataq is empty
and crawl is finished which is essentially job done) and
never notifies crawler thread to proceed with taking
snapshot.

The fix is to pick up the syncm if the crawler is finished
and dataq is empty to avoid missing notification to the
crawler thread.

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