diff options
author | Kefu Chai <kchai@redhat.com> | 2017-04-19 15:41:48 +0200 |
---|---|---|
committer | Kefu Chai <kchai@redhat.com> | 2017-04-20 03:35:05 +0200 |
commit | cc61bb878faa2ac745d4f9e4c63ef22eb9d9dd7a (patch) | |
tree | bd7cba50d1fdae79d6bcac59de727270ca4ead83 | |
parent | qa/tasks: update tests with helper to wait for pg-stats (diff) | |
download | ceph-cc61bb878faa2ac745d4f9e4c63ef22eb9d9dd7a.tar.xz ceph-cc61bb878faa2ac745d4f9e4c63ef22eb9d9dd7a.zip |
mon/OSDMonitor: use inc.modified as the ctime for MOSDPGCreate
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>
-rw-r--r-- | src/mon/OSDMonitor.cc | 5 | ||||
-rw-r--r-- | src/mon/OSDMonitor.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7daca9c887d..cca3f35273e 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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; } diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 32d08f78d3e..57861523117 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -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(); |