]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: filter the added creating_pgs added from pgmap
authorKefu Chai <kchai@redhat.com>
Fri, 2 Jun 2017 04:43:07 +0000 (12:43 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:06:50 +0000 (13:06 -0400)
the creating_pgs added from pgmap might contains pgs whose containing
pools have been deleted. this is fine with the PGMonitor, as it has the
updated pg mapping which is consistent with itself. but it does not work
with OSDMonitor's creating_pgs, whose pg mapping is calculated by
itself. so we need to filter the pgmap's creating_pgs when adding them to
OSDMonitor's creating_pgs with the latest osdmap.get_pools().

Fixes: http://tracker.ceph.com/issues/20067
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc
src/mon/PGMonitor.cc
src/mon/PGStatService.h

index 6924efb2c6acd343a0ef938ebd78707ad9c6d726..624c1c0ba343d7fba54e5af9daaaefd8077bc799 100644 (file)
@@ -955,6 +955,7 @@ OSDMonitor::update_pending_pgs(const OSDMap::Incremental& inc)
        osdmap.require_osd_release < CEPH_RELEASE_LUMINOUS) {
       auto added =
        mon->pgservice->maybe_add_creating_pgs(creating_pgs.last_scan_epoch,
+                                              osdmap.get_pools(),
                                               &pending_creatings);
       dout(7) << __func__ << " " << added << " pgs added from pgmap" << dendl;
     }
index 1fe56a1c5f65050fcd444edbfc020ad581b0489a..fc46cbf92d0698071ff77232fff926bec9cbb7cf 100644 (file)
@@ -1209,12 +1209,17 @@ public:
     return pgmap.creating_pgs.count(pgid);
   }
   unsigned maybe_add_creating_pgs(epoch_t scan_epoch,
-                             creating_pgs_t *pending_creates) const override {
+     const mempool::osdmap::map<int64_t,pg_pool_t>& pools,
+     creating_pgs_t *pending_creates) const override
+  {
     if (pgmap.last_pg_scan < scan_epoch) {
       return 0;
     }
     unsigned added = 0;
     for (auto& pgid : pgmap.creating_pgs) {
+      if (!pools.count(pgid.pool())) {
+       continue;
+      }
       auto st = pgmap.pg_stat.find(pgid);
       assert(st != pgmap.pg_stat.end());
       auto created = make_pair(st->second.created,
index 9dea3573617b233f7605f92d00447d0e37dae5fc..ee1b9856775c4674bcf556d1e4dc15df180715d4 100644 (file)
@@ -64,7 +64,8 @@ public:
    * creating_pgs (scan_epoch), insert them into the passed pending_creates.
    */
   virtual unsigned maybe_add_creating_pgs(epoch_t scan_epoch,
-                                         creating_pgs_t *pending_creates) const {
+     const mempool::osdmap::map<int64_t,pg_pool_t>& pools,
+     creating_pgs_t *pending_creates) const {
     ceph_abort();
     return 0;
   }