]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: osd add-no{up,down,in,out} - remove state checker 27605/head
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>
Tue, 16 Apr 2019 11:35:24 +0000 (19:35 +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>
src/mon/OSDMonitor.cc

index e5d031c9a37be0d27b0648ba63e2096e074011be..1a871d9c47730bbe82f34664905bae42a2446f5d 100644 (file)
@@ -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;