]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: osd add-no{up,down,in,out} - remove state checker
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 16 Apr 2019 09:30:13 +0000 (17:30 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 24 Apr 2019 01:08:22 +0000 (09:08 +0800)
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 <xie.xingguo@zte.com.cn>
(cherry picked from commit 100bd226900ed57d5826f3f1ea1b076fe2804d71)

src/mon/OSDMonitor.cc

index 2d9d86e29c7ce046d1539a915b09323917db3912..74e27a8bbdc7d2c88a5fe7c35fca21d6508615fb 100644 (file)
@@ -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;