From cc61bb878faa2ac745d4f9e4c63ef22eb9d9dd7a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 19 Apr 2017 21:41:48 +0800 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 5 ++++- src/mon/OSDMonitor.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7daca9c887d9..cca3f35273e3 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& pools, const set& 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& 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 32d08f78d3e0..578615231177 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& pools, const std::set& removed_pools, + utime_t modified, creating_pgs_t* creating_pgs) const; pair get_parent_pg(pg_t pgid) const; void update_creating_pgs(); -- 2.47.3