]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/mirroring: detect stale snapshot mirror sync metrics in omap
authorKotresh HR <khiremat@redhat.com>
Sun, 21 Jun 2026 17:28:38 +0000 (22:58 +0530)
committerKotresh HR <khiremat@redhat.com>
Wed, 8 Jul 2026 07:15:17 +0000 (12:45 +0530)
commit46d07d7d8d2aa16a2cebe2c97634de7af8031993
treef80679d856e8418a42740b83c1f41333075b5cb9
parentc49861d930892fe003bec201c153f1ad16e07b68
mgr/mirroring: detect stale snapshot mirror sync metrics in omap

Persisted metrics in the cephfs_mirror omap can outlive the writing
daemon when cephfs-mirror stops or a directory is reshuffled to another
instance; mgr would keep reporting stale progress until the owning
daemon writes again.

Extend format_and_order_sync_stat_for_display() to compare persisted
_instance_id against InstanceWatcher live instances (via
FSPolicy.get_live_instance_ids()) and the directory's tracked instance
(via Policy.get_tracked_instance_id()). Mark metrics stale when the
persisted writer is no longer live (any state), or when it does not
match the tracked instance while persisted state is not "idle". Show
state "stale" with current_syncing_snap omitted.

Pass policy and live instance ids through load_sync_stat_metrics() and
fetch_sync_stat_metrics(), and into sync_stat_complete_cache and
sync_stat_partial_cache loaders. Cache hits serve already-formatted
(stale-marked) entries until TTL expiry without re-checking instance
liveness.

Fixes: https://tracker.ceph.com/issues/76686
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 15e998b865b99b3091054321cf0fdf6df9f327ab)
src/pybind/mgr/mirroring/fs/dir_map/policy.py
src/pybind/mgr/mirroring/fs/metrics/format.py
src/pybind/mgr/mirroring/fs/metrics/load.py
src/pybind/mgr/mirroring/fs/snapshot_mirror.py