]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tools/cephfs_mirror: Synchronize taking snapshot
authorKotresh HR <khiremat@redhat.com>
Sat, 21 Feb 2026 08:28:47 +0000 (13:58 +0530)
committerKotresh HR <khiremat@redhat.com>
Sat, 21 Feb 2026 20:12:39 +0000 (01:42 +0530)
commit931226016f1efefcf1354c7cda3e6b1628bbb4bd
tree9e558970a7b8e67c422e8da6b9813b256246c874
parent994ec7d61cb6580f6fd3f418f8edbced080ca1dc
tools/cephfs_mirror: Synchronize taking snapshot

The crawler/entry creation thread needs to wait until
all the data is synced by datasync threads to take
the snapshot. This patch adds the necessary conditions
for the same.

It is important for the conditional flag to be part
of SyncMechanism and not part of PeerReplayer class.
The following bug would be hit if it were part of
PeerReplayer class.

When multiple directories are confiugred for mirroring as below
/d0                /d1              /d2
Crawler1         Crawler2          Crawler3
DoneEntryOps     DoneEntryOps      DoneEntryOps
WaitForSafeSnap  WaitForSafeSnap   WaitForSafeSnap

When all crawler threads are waiting at above, the data sync threads
which is done processing /d1, would notify, waking up all the crawlers
causing spurious/unwanted wake up and half baked snapshots.

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