From: tancz1 Date: Tue, 26 Oct 2021 09:25:20 +0000 (+0800) Subject: osd: fix 'ceph osd stop ' doesn't take effect X-Git-Tag: v16.2.8~221^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=52b8ec639006001cba668d76e83da5ee9e4a30f4;p=ceph.git osd: fix 'ceph osd stop ' doesn't take effect when the osd state is in the non-active state, the osd daemon can be stopped. Fixes: https://tracker.ceph.com/issues/53039 Signed-off-by: tan changzhi <544463199@qq.com> (cherry picked from commit d595c95ef6c3dc34b8389ff4270639ff1550d269) --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8dceddae384c4..ce9079796e1c8 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -8457,6 +8457,9 @@ void OSD::_committed_osd_maps(epoch_t first, epoch_t last, MOSDMap *m) reset_heartbeat_peers(true); } } + } else if (osdmap->get_epoch() > 0 && osdmap->is_stop(whoami)) { + derr << "map says i am stopped by admin. shutting down." << dendl; + do_shutdown = true; } map_lock.unlock();