]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/MDSMonitor: send reply to beacons with `state=DNE`
authorMax Kellermann <max.kellermann@ionos.com>
Mon, 14 Oct 2024 17:52:23 +0000 (19:52 +0200)
committerMax Kellermann <max.kellermann@ionos.com>
Tue, 29 Oct 2024 20:41:48 +0000 (21:41 +0100)
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 <max.kellermann@ionos.com>
src/mon/MDSMonitor.cc

index d8cca4ceb61b1f208c820b10cc9ee4593fc48bde..f742303c6e91eb3007500fa730f02ef77d1ee742 100644 (file)
@@ -758,6 +758,14 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
 
     if (state == MDSMap::STATE_DNE) {
       dout(1) << __func__ << ": DNE from " << info << dendl;
+
+      /* send a beacon reply so MDSDaemon::suicide() finishes the
+         Beacon::send_and_wait() call */
+      auto beacon = make_message<MMDSBeacon>(mon.monmap->fsid,
+          m->get_global_id(), m->get_name(), get_fsmap().get_epoch(),
+          m->get_state(), m->get_seq(), CEPH_FEATURES_SUPPORTED_DEFAULT);
+      mon.send_reply(op, beacon.detach());
+
       goto evict;
     }