mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
CacheTier: set cache_min_evict_age is effective
Signed-off-by: Tao Chang <changtao@hihuron.com>
This commit is contained in:
parent
64fbda8371
commit
ab7d3decbf
@ -11766,6 +11766,19 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc, bool after_flush)
|
||||
}
|
||||
|
||||
if (agent_state->evict_mode != TierAgentState::EVICT_MODE_FULL) {
|
||||
// is this object old than cache_min_evict_age?
|
||||
utime_t now = ceph_clock_now(NULL);
|
||||
utime_t ob_local_mtime;
|
||||
if (obc->obs.oi.local_mtime != utime_t()) {
|
||||
ob_local_mtime = obc->obs.oi.local_mtime;
|
||||
} else {
|
||||
ob_local_mtime = obc->obs.oi.mtime;
|
||||
}
|
||||
if (ob_local_mtime + utime_t(pool.info.cache_min_evict_age, 0) > now) {
|
||||
dout(20) << __func__ << " skip (too young) " << obc->obs.oi << dendl;
|
||||
osd->logger->inc(l_osd_agent_skip);
|
||||
return false;
|
||||
}
|
||||
// is this object old and/or cold enough?
|
||||
int temp = 0;
|
||||
uint64_t temp_upper = 0, temp_lower = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user