]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: use inc.modified as the ctime for MOSDPGCreate 14608/head
authorKefu Chai <kchai@redhat.com>
Wed, 19 Apr 2017 13:41:48 +0000 (21:41 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 20 Apr 2017 01:35:05 +0000 (09:35 +0800)
so the last_scrub_time of the newly created pg is consistent

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

index 7daca9c887d965314b620749f84266a9ed71f462..cca3f35273e3dbfbcd2dfb9ad7d94e2b0e586f39 100644 (file)
@@ -851,9 +851,11 @@ OSDMonitor::update_pending_creatings(const OSDMap::Incremental& inc)
   }
   scan_for_creating_pgs(osdmap.get_pools(),
                        inc.old_pools,
+                       inc.modified,
                        &pending_creatings);
   scan_for_creating_pgs(inc.new_pools,
                        inc.old_pools,
+                       inc.modified,
                        &pending_creatings);
   pending_creatings.last_scan_epoch = osdmap.get_epoch();
   return pending_creatings;
@@ -2982,6 +2984,7 @@ void OSDMonitor::check_pg_creates_sub(Subscription *sub)
 
 void OSDMonitor::scan_for_creating_pgs(const map<int64_t,pg_pool_t>& pools,
                                       const set<int64_t>& removed_pools,
+                                      utime_t modified,
                                       creating_pgs_t* creating_pgs) const
 {
   for (auto& p : pools) {
@@ -3017,7 +3020,7 @@ void OSDMonitor::scan_for_creating_pgs(const map<int64_t,pg_pool_t>& pools,
        dout(20) << __func__ << " already have " << pgid << dendl;
        continue;
       }
-      creating_pgs->pgs.emplace(pgid, make_pair(created, ceph_clock_now()));
+      creating_pgs->pgs.emplace(pgid, make_pair(created, modified));
       dout(10) << __func__ << " adding " << pgid
               << " at " << osdmap.get_epoch() << dendl;
     }
index 32d08f78d3e07fc6ea5c5bcf141215648938012e..57861523117705c95205c23b722a25971a13ccb1 100644 (file)
@@ -428,6 +428,7 @@ private:
   void trim_creating_pgs(creating_pgs_t *creating_pgs, const PGMap& pgm);
   void scan_for_creating_pgs(const std::map<int64_t,pg_pool_t>& pools,
                             const std::set<int64_t>& removed_pools,
+                            utime_t modified,
                             creating_pgs_t* creating_pgs) const;
   pair<int32_t, pg_t> get_parent_pg(pg_t pgid) const;
   void update_creating_pgs();