From: Kotresh HR Date: Tue, 9 Dec 2025 10:05:08 +0000 (+0530) Subject: tools/cephfs_mirror: Mark crawl finished X-Git-Tag: testing/wip-vshankar-testing-20260224.100235^2~25 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=36a7acf3160a993cc4afadc46a83be8e2c9a87bc;p=ceph-ci.git tools/cephfs_mirror: Mark crawl finished After entry operations are synced and stack is empty, mark the crawl as finished so the data sync threads' wait logic works correctly and doesn't indefinitely wait. Fixes: https://tracker.ceph.com/issues/73452 Signed-off-by: Kotresh HR --- diff --git a/src/tools/cephfs_mirror/PeerReplayer.cc b/src/tools/cephfs_mirror/PeerReplayer.cc index b7b09c9c04c..0ac65efd456 100644 --- a/src/tools/cephfs_mirror/PeerReplayer.cc +++ b/src/tools/cephfs_mirror/PeerReplayer.cc @@ -1641,7 +1641,7 @@ int PeerReplayer::SnapDiffSync::get_changed_blocks(const std::string &epath, return r; } -void PeerReplayer::SnapDiffSync::finish_sync() { +void PeerReplayer::SnapDiffSync::finish_crawl() { dout(20) << dendl; while (!m_sync_stack.empty()) { @@ -1655,6 +1655,9 @@ void PeerReplayer::SnapDiffSync::finish_sync() { m_sync_stack.pop(); } + + // Crawl and entry operations are done syncing here. So mark crawl finished here + mark_crawl_finished(); } PeerReplayer::RemoteSync::RemoteSync(MountRef local, MountRef remote, FHandles *fh, @@ -1787,7 +1790,7 @@ int PeerReplayer::RemoteSync::get_entry(std::string *epath, struct ceph_statx *s return 0; } -void PeerReplayer::RemoteSync::finish_sync() { +void PeerReplayer::RemoteSync::finish_crawl() { dout(20) << dendl; while (!m_sync_stack.empty()) { @@ -1801,6 +1804,9 @@ void PeerReplayer::RemoteSync::finish_sync() { m_sync_stack.pop(); } + + // Crawl and entry operations are done syncing here. So mark stack finished here + mark_crawl_finished(); } int PeerReplayer::do_synchronize(const std::string &dir_root, const Snapshot ¤t, @@ -1903,7 +1909,7 @@ int PeerReplayer::do_synchronize(const std::string &dir_root, const Snapshot &cu } } - syncm->finish_sync(); + syncm->finish_crawl(); dout(20) << " cur:" << fh.c_fd << " prev:" << fh.p_fd diff --git a/src/tools/cephfs_mirror/PeerReplayer.h b/src/tools/cephfs_mirror/PeerReplayer.h index e7c9d969b26..f75a508753f 100644 --- a/src/tools/cephfs_mirror/PeerReplayer.h +++ b/src/tools/cephfs_mirror/PeerReplayer.h @@ -193,7 +193,7 @@ private: const struct ceph_statx &stx, bool sync_check, const std::function &callback); - virtual void finish_sync() = 0; + virtual void finish_crawl() = 0; void push_dataq_entry(PeerReplayer::SyncEntry e); bool pop_dataq_entry(PeerReplayer::SyncEntry &out); @@ -227,7 +227,7 @@ private: const std::function &dirsync_func, const std::function &purge_func); - void finish_sync(); + void finish_crawl(); }; class SnapDiffSync : public SyncMechanism { @@ -247,7 +247,7 @@ private: const struct ceph_statx &stx, bool sync_check, const std::function &callback); - void finish_sync(); + void finish_crawl(); private: int init_directory(const std::string &epath,