]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix 'ceph osd stop <osd.nnn>' doesn't take effect 43955/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 14:33:34 +0000 (09:33 -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 8dceddae384c4614adeccdb83057f7ce3c9070f6..ce9079796e1c8f88a778c5f73017e9db3f517d27 100644 (file)
@@ -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();