Skip to content

Commit fd9c404

Browse files
committed
mon/MDSMonitor: send reply to beacons with state=DNE
During shutdown, the MDS sends a `MSG_MDS_BEACON` with `MDSMap::STATE_DNE` (in `MDSDaemon::suicide()`) and then waits for a `MSG_MDS_BEACON` reply from the MON. The MON, however, suppresses replies to `STATE_DNE`; in `MDSMonitor::preprocess_beacon()`, it returns early on `STATE_DNE` and `MDSMonitor::prepare_beacon()` silently evicts the dying MDS without any reply. This delays the MDS shutdown until the MDS times out. Since `MDSDaemon::suicide()` has code to wait for a beacon reply, I figure that the MON reply was suppressed accidently, therefore I suggest adding it. Fixes: https://tracker.ceph.com/issues/68761 Signed-off-by: Max Kellermann <[email protected]>
1 parent a3cf842 commit fd9c404

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mon/MDSMonitor.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,14 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
758758

759759
if (state == MDSMap::STATE_DNE) {
760760
dout(1) << __func__ << ": DNE from " << info << dendl;
761+
762+
/* send a beacon reply so MDSDaemon::suicide() finishes the
763+
Beacon::send_and_wait() call */
764+
auto beacon = make_message<MMDSBeacon>(mon.monmap->fsid,
765+
m->get_global_id(), m->get_name(), get_fsmap().get_epoch(),
766+
m->get_state(), m->get_seq(), CEPH_FEATURES_SUPPORTED_DEFAULT);
767+
mon.send_reply(op, beacon.detach());
768+
761769
goto evict;
762770
}
763771

0 commit comments

Comments
 (0)