]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Cache tiering: use local_mtime to calculate the age of objects during 2352/head
authorZhiqiang Wang <wonzhq@hotmail.com>
Fri, 29 Aug 2014 08:06:30 +0000 (16:06 +0800)
committerZhiqiang Wang <wonzhq@hotmail.com>
Fri, 29 Aug 2014 08:06:30 +0000 (16:06 +0800)
evicting

Commit 13b9dc70 introduces local_mtime to fix an issue when doing
flushing. Should also use this to calculate the object age when doing
evicting.

Signed-off-by: Zhiqiang Wang <wonzhq@hotmail.com>
src/osd/ReplicatedPG.cc

index b52f2e71352624d95509af74c3e874057782a2af..411c72ad8d4e43c15fa69eb195eaeb2b559ddaf3 100644 (file)
@@ -11597,8 +11597,13 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc)
     agent_estimate_atime_temp(soid, &atime, NULL /*FIXME &temp*/);
 
     uint64_t atime_upper = 0, atime_lower = 0;
-    if (atime < 0 && obc->obs.oi.mtime != utime_t())
-      atime = ceph_clock_now(NULL).sec() - obc->obs.oi.mtime;
+    if (atime < 0 && obc->obs.oi.mtime != utime_t()) {
+      if (obc->obs.oi.local_mtime != utime_t()) {
+        atime = ceph_clock_now(NULL).sec() - obc->obs.oi.local_mtime;
+      } else {
+        atime = ceph_clock_now(NULL).sec() - obc->obs.oi.mtime;
+      }
+    }
     if (atime < 0)
       atime = pool.info.hit_set_period * pool.info.hit_set_count; // "infinite"
     if (atime >= 0) {