Skip to content

Commit 947a536

Browse files
author
Prasanna Kumar Kalever
committed
rbd-mirror: fix image replayer shut down description on force promote
On force promote if the opposite site is down then we currently show image status description as "local image linked to unknown peer" Previously: ---------- $ rbd --cluster=site-b mirror image status pool1/img1 img1: global_id: a73341a6-8302-4c97-ac6e-278083fd347e state: up+stopping_replay description: local image linked to unknown peer service: admin on localhost.localdomain last_update: 2023-06-15 19:47:45 peer_sites: name: site-a state: up+stopped description: local image is primary last_update: 2023-06-15 19:47:32 snapshots: 9 .mirror.primary.a73341a6-8302-4c97-ac6e-278083fd347e.1f101367-277f-42f0-8308-e51201d0529a (peer_uuids:[c46c6d97-f59b-4591-9d35-d7ff9d0d72f7]) Currently: --------- $ rbd --cluster=site-b mirror image status pool1/img1 img1: global_id: 2a6d61e1-8e76-42c4-af76-8f61ce65c7e2 state: up+stopped description: orphan (force promoting) service: admin on localhost.localdomain last_update: 2023-06-15 19:29:22 peer_sites: name: site-a state: down+stopped description: local image is primary last_update: 2023-06-15 19:29:05 snapshots: 9 .mirror.primary.2a6d61e1-8e76-42c4-af76-8f61ce65c7e2.99f82a30-0241-4e51-8428-7a2376d137f6 (peer_uuids:[3150c6ef-aeee-45dc-8d0e-5dc5a53d88eb]) Fixes: https://tracker.ceph.com/issues/52913 Signed-off-by: Prasanna Kumar Kalever <[email protected]>
1 parent 0ea177e commit 947a536

File tree

1 file changed

+5
-0
lines changed
  • src/tools/rbd_mirror/image_replayer/snapshot

1 file changed

+5
-0
lines changed

src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,11 @@ void Replayer<I>::scan_local_mirror_snapshots(
542542
if (m_local_mirror_snap_ns.is_non_primary() &&
543543
m_local_mirror_snap_ns.primary_mirror_uuid !=
544544
m_state_builder->remote_mirror_uuid) {
545+
if (m_local_mirror_snap_ns.is_orphan()) {
546+
dout(5) << "local image being force promoted" << dendl;
547+
handle_replay_complete(locker, 0, "orphan (force promoting)");
548+
return;
549+
}
545550
// TODO support multiple peers
546551
derr << "local image linked to unknown peer: "
547552
<< m_local_mirror_snap_ns.primary_mirror_uuid << dendl;

0 commit comments

Comments
 (0)