]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix 'ceph osd stop <osd.nnn>' doesn't take effect 43962/head
authortancz1 <tancz1@lenovo.com>
Tue, 26 Oct 2021 09:25:20 +0000 (17:25 +0800)
committerCory Snyder <csnyder@iland.com>
Tue, 16 Nov 2021 15:01:33 +0000 (10:01 -0500)
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)

src/osd/OSD.cc

index c42fd05bedf01f02f31302f8c5e2c42b5534b196..4ba6ef84f90850767fca53e2ab15e0764e02b67f 100644 (file)
@@ -8287,6 +8287,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();