]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: use spg_t for pending_creates_from_osd
authorSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 16:44:55 +0000 (10:44 -0600)
committerSage Weil <sage@redhat.com>
Mon, 9 Dec 2019 16:44:55 +0000 (10:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 9f332d3b609a89628e9beb722ebb4588799e6ffa..4770ef7e601cc10af1e82fc7af57e6d3962c78ea 100644 (file)
@@ -4869,7 +4869,7 @@ bool OSD::maybe_wait_for_max_pg(const OSDMapRef& osdmap,
     pending_creates_from_mon++;
   } else {
     bool is_primary = osdmap->get_pg_acting_rank(pgid.pgid, whoami) == 0;
-    pending_creates_from_osd.emplace(pgid.pgid, is_primary);
+    pending_creates_from_osd.emplace(pgid, is_primary);
   }
   dout(1) << __func__ << " withhold creation of pg " << pgid
          << ": " << num_pgs << " >= "<< max_pgs_per_osd << dendl;
@@ -4918,8 +4918,8 @@ void OSD::resume_creating_pg()
     while (spare_pgs > 0 && pg != pending_creates_from_osd.cend()) {
       dout(20) << __func__ << " pg " << pg->first << dendl;
       vector<int> acting;
-      osdmap->pg_to_up_acting_osds(pg->first, nullptr, nullptr, &acting, nullptr);
-      service.queue_want_pg_temp(pg->first, twiddle(acting), true);
+      osdmap->pg_to_up_acting_osds(pg->first.pgid, nullptr, nullptr, &acting, nullptr);
+      service.queue_want_pg_temp(pg->first.pgid, twiddle(acting), true);
       pg = pending_creates_from_osd.erase(pg);
       do_sub_pg_creates = true;
       spare_pgs--;
@@ -8725,7 +8725,7 @@ void OSD::consume_map()
     std::lock_guard l(pending_creates_lock);
     for (auto pg = pending_creates_from_osd.begin();
         pg != pending_creates_from_osd.end();) {
-      if (osdmap->get_pg_acting_rank(pg->first, whoami) < 0) {
+      if (osdmap->get_pg_acting_rank(pg->first.pgid, whoami) < 0) {
        dout(10) << __func__ << " pg " << pg->first << " doesn't map here, "
                 << "discarding pending_create_from_osd" << dendl;
        pg = pending_creates_from_osd.erase(pg);
index 58ef72b73436ebd40ad3fdba1a85f786f02ee3c2..21c6e92e36f82a1a89ebd9b3f20861b890b98dc3 100644 (file)
@@ -1766,7 +1766,7 @@ protected:
   std::atomic<size_t> num_pgs = {0};
 
   std::mutex pending_creates_lock;
-  using create_from_osd_t = std::pair<pg_t, bool /* is primary*/>;
+  using create_from_osd_t = std::pair<spg_t, bool /* is primary*/>;
   std::set<create_from_osd_t> pending_creates_from_osd;
   unsigned pending_creates_from_mon = 0;