Re: [PATCH] ceph: use the OSD time as the object mtime instead of the client time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 29 Jul 2014, Wang, Zhiqiang wrote:
> This fixes a bug when the time of the OSDs and clients are not synchronized
> (especially when client is ahead of OSD), and the cache tier dirty ratio
> reaches the threshold, the agent skips the flush work because it thinks
> the object is too young.
> 
> The skipping flush code is as following:
> 
>   if (obc->obs.oi.mtime + utime_t(pool.info.cache_min_flush_age, 0) > now) {
>     dout(20) << __func__ << " skip (too young) " << obc->obs.oi << dendl;
>     osd->logger->inc(l_osd_agent_skip);
>     return false;
>   }

Hmm, I think the use of the client mtime is an important property we want 
to maintain for the benefit of the rest of the system.  Two other 
possibilities:

1) If cache_min_flush_age is 0, skip the check, so we avoid mtimes in the 
future in that case.

2) Add an additional field to object_info_t that is an mtime based on the 
OSD's clock, and use that for these checks.

What do you think?
sage


> 
> Signed-off-by: Zhiqiang Wang <wonzhq@xxxxxxxxxxx>
> ---
>  src/osd/ReplicatedPG.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
> index 5d822c1..1c7c527 100644
> --- a/src/osd/ReplicatedPG.cc
> +++ b/src/osd/ReplicatedPG.cc
> @@ -1805,7 +1805,7 @@ void ReplicatedPG::execute_ctx(OpContext *ctx)
> 
>      // version
>      ctx->at_version = get_next_version();
> -    ctx->mtime = m->get_mtime();
> +    ctx->mtime = ceph_clock_now(cct);
> 
>      dout(10) << "do_op " << soid << " " << ctx->ops
>              << " ov " << obc->obs.oi.version << " av " << ctx->at_version
> --
> 1.9.1
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux