]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix 'ceph osd stop <osd.nnn>' doesn't take effect 43664/head
authortancz1 <tancz1@lenovo.com>
Tue, 26 Oct 2021 09:25:20 +0000 (17:25 +0800)
committertancz1 <tancz1@lenovo.com>
Wed, 27 Oct 2021 04:38:19 +0000 (12:38 +0800)
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>
src/osd/OSD.cc

index 0d8050565636643de9d3a57960c4801a8ec8dcb3..67664389c879b266b7b776cba3dbb384d8ba1e01 100644 (file)
@@ -8341,6 +8341,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();