From: Sage Weil Date: Wed, 22 Mar 2017 18:21:46 +0000 (-0500) Subject: mon/PGMap: set initial pg timestamp as osdmap modified stamp X-Git-Tag: v12.0.2~252^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc51f56bb2c153bf35078eb95311e1d35c118c9f;p=ceph.git mon/PGMap: set initial pg timestamp as osdmap modified stamp Currently the PGMap may register the new pg in multiple places: the mgr or mon, and the timestamp is when the mon or mgr gets around to recording it into its PGMap. Make this deterministic by using the OSDMap mtime (which is when the PG was *actually* created). This fixes a problem where the pg create command has one timestamp (from the mon) and the pgmap on the mgr has another, so an observer will see the last_scrub_stamp (and other timestamps) change when nothing has actually happened. Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 50d2e7755d0f..ecf2fea9d793 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -2492,7 +2492,7 @@ void PGMapUpdater::register_pg( stats.last_deep_scrub_stamp = ps.last_deep_scrub_stamp; stats.last_clean_scrub_stamp = ps.last_clean_scrub_stamp; } else { - utime_t now = ceph_clock_now(); + utime_t now = osd_map.get_modified(); stats.last_fresh = now; stats.last_active = now; stats.last_change = now;