From patchwork Tue Jul 29 05:07:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Zhiqiang" X-Patchwork-Id: 4638541 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC009C0338 for ; Tue, 29 Jul 2014 05:07:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 126F620173 for ; Tue, 29 Jul 2014 05:07:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 376952014A for ; Tue, 29 Jul 2014 05:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbaG2FHl (ORCPT ); Tue, 29 Jul 2014 01:07:41 -0400 Received: from mga01.intel.com ([192.55.52.88]:7330 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbaG2FHe convert rfc822-to-8bit (ORCPT ); Tue, 29 Jul 2014 01:07:34 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 28 Jul 2014 22:07:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,754,1400050800"; d="scan'208";a="576926879" Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2014 22:07:18 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 28 Jul 2014 22:07:18 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 28 Jul 2014 22:07:18 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.52]) by shsmsx102.ccr.corp.intel.com ([169.254.2.120]) with mapi id 14.03.0123.003; Tue, 29 Jul 2014 13:07:17 +0800 From: "Wang, Zhiqiang" To: "ceph-devel@vger.kernel.org" CC: Sage Weil Subject: [PATCH] ceph: use the OSD time as the object mtime instead of the client time Thread-Topic: [PATCH] ceph: use the OSD time as the object mtime instead of the client time Thread-Index: Ac+q6opfALU8UVZ9StCiJiXHnZBAcw== Date: Tue, 29 Jul 2014 05:07:15 +0000 Message-ID: <06E7D85B3BA36C4DB207FEDE871C534891D8CB@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; } Signed-off-by: Zhiqiang Wang --- src/osd/ReplicatedPG.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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