From 100bd226900ed57d5826f3f1ea1b076fe2804d71 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Tue, 16 Apr 2019 17:30:13 +0800 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e5d031c9a37b..1a871d9c4773 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -10573,11 +10573,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; @@ -10589,11 +10584,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; @@ -10605,11 +10595,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; @@ -10621,11 +10606,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; -- 2.47.3