]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Get the currently atime of the object in cache pool for eviction
authorXinze Chi <xmdxcxz@gmail.com>
Wed, 29 Oct 2014 07:11:11 +0000 (07:11 +0000)
committerLoic Dachary <ldachary@redhat.com>
Thu, 19 Mar 2015 09:16:28 +0000 (10:16 +0100)
Because if there are mutiple atime in agent_state for the same object, we should use the recently one.

Signed-off-by: Xinze Chi <xmdxcxz@gmail.com>
(cherry picked from commit 1fef4c3d541cba360738437420ebfa2447d5802e)

src/osd/ReplicatedPG.cc

index b9edd70f44be7a0688935cf91e769fde1f5a5309..1ad6a67e25907055bc2fcc8e29b2a899cf1a852e 100644 (file)
@@ -11914,8 +11914,8 @@ void ReplicatedPG::agent_estimate_atime_temp(const hobject_t& oid,
       return;
   }
   time_t now = ceph_clock_now(NULL).sec();
-  for (map<time_t,HitSetRef>::iterator p = agent_state->hit_set_map.begin();
-       p != agent_state->hit_set_map.end();
+  for (map<time_t,HitSetRef>::iterator p = agent_state->hit_set_map.rbegin();
+       p != agent_state->hit_set_map.rend();
        ++p) {
     if (p->second->contains(oid)) {
       if (*atime < 0)