From: xie xingguo Date: Tue, 16 Apr 2019 09:30:13 +0000 (+0800) Subject: mon/OSDMonitor: osd add-no{up,down,in,out} - remove state checker X-Git-Tag: v14.2.2~213^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a34e340f82fb6224f7898b603fb24cc225bd5bde;p=ceph.git mon/OSDMonitor: osd add-no{up,down,in,out} - remove state checker The existing sanity checkers are total unnecessary, e.g, noup indicates we should not allow the corresponding osd to boot (marked as up) later on, which has nothing to do with the current existing osd states. By removing these checkers, we can: $ ceph osd add-noup osd.nnn $ ceph osd down osd.nnn this way we can manually mark a specific osd as down and then ensure it will not be automatically marked as up until the specific restrictions has been resolved. Signed-off-by: xie xingguo (cherry picked from commit 100bd226900ed57d5826f3f1ea1b076fe2804d71) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 2d9d86e29c7c..74e27a8bbdc7 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -10604,11 +10604,6 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, switch (option) { case OP_NOUP: - if (osdmap.is_up(osd)) { - ss << "osd." << osd << " is already up. "; - continue; - } - if (osdmap.is_noup(osd)) { if (pending_inc.pending_osd_state_clear(osd, CEPH_OSD_NOUP)) any = true; @@ -10620,11 +10615,6 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, break; case OP_NODOWN: - if (osdmap.is_down(osd)) { - ss << "osd." << osd << " is already down. "; - continue; - } - if (osdmap.is_nodown(osd)) { if (pending_inc.pending_osd_state_clear(osd, CEPH_OSD_NODOWN)) any = true; @@ -10636,11 +10626,6 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, break; case OP_NOIN: - if (osdmap.is_in(osd)) { - ss << "osd." << osd << " is already in. "; - continue; - } - if (osdmap.is_noin(osd)) { if (pending_inc.pending_osd_state_clear(osd, CEPH_OSD_NOIN)) any = true; @@ -10652,11 +10637,6 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, break; case OP_NOOUT: - if (osdmap.is_out(osd)) { - ss << "osd." << osd << " is already out. "; - continue; - } - if (osdmap.is_noout(osd)) { if (pending_inc.pending_osd_state_clear(osd, CEPH_OSD_NOOUT)) any = true;