]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: Replace get_out_osds with get_out_existing_osds 28142/head
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 17 Apr 2019 06:13:27 +0000 (16:13 +1000)
committerPrashant D <pdhange@redhat.com>
Tue, 11 Jun 2019 05:50:15 +0000 (01:50 -0400)
Fixes: http://tracker.ceph.com/issues/39154
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit adfb6a595363e2c085c6eac3001fcaa2dce007aa)

Conflicts:
src/osd/OSDMap.h : Resovled for get_out_existing_osds

src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h

index da9c7d992464dacf239215e3187a34e3e87207c3..9cee973927d12c5d9d2359ccfa06969255c64df6 100644 (file)
@@ -9762,7 +9762,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
           (idvec[0] == "any" || idvec[0] == "all" || idvec[0] == "*")) {
         if (prefix == "osd in") {
           // touch out osds only
-          osdmap.get_out_osds(osds);
+          osdmap.get_out_existing_osds(osds);
         } else {
           osdmap.get_all_osds(osds);
         }
index 66172314c19373c7048997381f33aedb7f403d15..45500af0257cd365975cbb95e491d8a957843223 100644 (file)
@@ -1274,10 +1274,10 @@ void OSDMap::get_up_osds(set<int32_t>& ls) const
   }
 }
 
-void OSDMap::get_out_osds(set<int32_t>& ls) const
+void OSDMap::get_out_existing_osds(set<int32_t>& ls) const
 {
   for (int i = 0; i < max_osd; i++) {
-    if (is_out(i))
+    if (exists(i) && get_weight(i) == CEPH_OSD_OUT)
       ls.insert(i);
   }
 }
index e9706f15213c2859fbe6ee22a51a6df5d7227937..7c6cf41b080d1b351f627338640c22064f346f6f 100644 (file)
@@ -699,7 +699,7 @@ public:
 
   void get_all_osds(set<int32_t>& ls) const;
   void get_up_osds(set<int32_t>& ls) const;
-  void get_out_osds(set<int32_t>& ls) const;
+  void get_out_existing_osds(set<int32_t>& ls) const;
   unsigned get_num_pg_temp() const {
     return pg_temp->size();
   }