From 1b4272601a1118fa4827ef8fa924649b778392cb Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Fri, 29 Aug 2014 16:06:30 +0800 Subject: [PATCH] Cache tiering: use local_mtime to calculate the age of objects during 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 --- src/osd/ReplicatedPG.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b52f2e71352..411c72ad8d4 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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) {