From 1548a3fda7dd63e28792140e7e8ad1ac9b706e49 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 14 Dec 2015 13:00:27 -0500 Subject: [PATCH] osd/ReplicatedPG: do not set local_mtime on non-tiered pool If a pool isn't tiered, don't bother with setting local_mtime. The only users are the tiering agent (which isn't needed if there is not tiering) and scrub for deciding if an object should get its digest recorded (we can use mtime instead). Signed-off-by: Sage Weil --- src/osd/ReplicatedPG.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7d23687bea3e8..b255b9fa6aaa0 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5760,7 +5760,10 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc ctx->snapset_obc->obs.oi.version = ctx->at_version; ctx->snapset_obc->obs.oi.last_reqid = ctx->reqid; ctx->snapset_obc->obs.oi.mtime = ctx->mtime; - ctx->snapset_obc->obs.oi.local_mtime = now; + if (pool.info.is_tier() || pool.info.has_tiers()) + ctx->snapset_obc->obs.oi.local_mtime = now; + else + ctx->snapset_obc->obs.oi.local_mtime = utime_t(); bufferlist bv(sizeof(ctx->new_obs.oi)); ::encode(ctx->snapset_obc->obs.oi, bv); @@ -5801,7 +5804,10 @@ void ReplicatedPG::finish_ctx(OpContext *ctx, int log_op_type, bool maintain_ssc if (ctx->mtime != utime_t()) { ctx->new_obs.oi.mtime = ctx->mtime; dout(10) << " set mtime to " << ctx->new_obs.oi.mtime << dendl; - ctx->new_obs.oi.local_mtime = now; + if (pool.info.is_tier() || pool.info.has_tiers()) + ctx->new_obs.oi.local_mtime = now; + else + ctx->new_obs.oi.local_mtime = utime_t(); } else { dout(10) << " mtime unchanged at " << ctx->new_obs.oi.mtime << dendl; } -- 2.39.5