From: Sage Weil Date: Mon, 14 Dec 2015 18:00:27 +0000 (-0500) Subject: osd/ReplicatedPG: do not set local_mtime on non-tiered pool X-Git-Tag: v0.94.6~50^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1548a3fda7dd63e28792140e7e8ad1ac9b706e49;p=ceph.git 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 7d23687bea3e..b255b9fa6aaa 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; }