]> 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>
Wed, 11 Mar 2015 09:24:00 +0000 (10:24 +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 f1911c13f947b5ebe2cbeffb19aaa755f3b0fc8a..5225372e43b2ca0f2573251931f5c89eb92ee320 100644 (file)
@@ -11662,8 +11662,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)