]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: fix fast pg create vs limits
authorSage Weil <sage@redhat.com>
Wed, 21 Feb 2018 03:23:25 +0000 (21:23 -0600)
committerSage Weil <sage@redhat.com>
Wed, 4 Apr 2018 13:26:56 +0000 (08:26 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 6edf496a6cf710c52c59456f5e7d09fdb7bf29f0..fae0fc28c8c6b55d833a3c707feb19f10de1ef49 100644 (file)
@@ -3982,6 +3982,8 @@ void OSD::resume_creating_pg()
     unsigned spare_pgs = max_pgs_per_osd - num_pgs;
     [[gnu::unused]] auto&& locker = guardedly_lock(pending_creates_lock);
     if (pending_creates_from_mon > 0) {
+      dout(20) << __func__ << " pending_creates_from_mon "
+              << pending_creates_from_mon << dendl;
       do_sub_pg_creates = true;
       if (pending_creates_from_mon >= spare_pgs) {
        spare_pgs = pending_creates_from_mon = 0;
@@ -3992,6 +3994,7 @@ void OSD::resume_creating_pg()
     }
     auto pg = pending_creates_from_osd.cbegin();
     while (spare_pgs > 0 && pg != pending_creates_from_osd.cend()) {
+      dout(20) << __func__ << " pg " << pg->first << dendl;
       if (!pgtemp) {
        pgtemp = new MOSDPGTemp{osdmap->get_epoch()};
       }
@@ -4025,7 +4028,7 @@ void OSD::resume_creating_pg()
     // no need to subscribe the osdmap continuously anymore
     // once the pgtemp and/or mon_subscribe(pg_creates) is sent
     if (monc->sub_want_increment("osdmap", start, CEPH_SUBSCRIBE_ONETIME)) {
-      dout(4) << __func__ << ": re-subscribe osdmap(onetime) since"
+      dout(4) << __func__ << ": re-subscribe osdmap(onetime) since "
              << start << dendl;
       do_renew_subs = true;
     }
@@ -8314,6 +8317,13 @@ void OSD::handle_fast_pg_create(MOSDPGCreate2 *m)
            true)
          )));
   }
+
+  with_unique_lock(pending_creates_lock, [=]() {
+      if (pending_creates_from_mon == 0) {
+       last_pg_create_epoch = m->epoch;
+      }
+    });
+
   m->put();
 }