Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8pFD-0007mg-Qg for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2019 16:48:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h8pFB-0005t3-Q7 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2019 16:48:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8pFB-0005na-FD for pgsql-hackers@lists.postgresql.org; Tue, 26 Mar 2019 16:48:09 +0000 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h8pF8-0003q6-QM for pgsql-hackers@postgresql.org; Tue, 26 Mar 2019 16:48:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1553618886; x=1585154886; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=KZSnEcxmQrFOzFb2AJSNSoDy+l0rW8HQiOvCkSxm9hk=; b=vMQQU/u6ovibDksgGlFfBFif2o66vwkFSTtVPPQzFTp59mRNplkESYM8 hDGu89zKCmdugRuZDd7G+h7FA6SU1ZnKpqXBB1Yzt67nHwzrhOExsRS6M K8TbmRO0jvv3BaKD+hL51EpDmF0sA7K+ExtNOoVrDJ5f+9xuHg5Uyj5E9 E=; X-IronPort-AV: E=Sophos;i="5.60,273,1549929600"; d="scan'208";a="387513245" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 26 Mar 2019 16:48:02 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-7d76a15f.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x2QGlv7k038274 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 26 Mar 2019 16:48:00 GMT Received: from EX13D05UWC002.ant.amazon.com (10.43.162.92) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 26 Mar 2019 16:48:00 +0000 Received: from f01898859afd.ant.amazon.com (10.43.162.111) by EX13D05UWC002.ant.amazon.com (10.43.162.92) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 26 Mar 2019 16:48:00 +0000 Date: Tue, 26 Mar 2019 09:47:58 -0700 From: Shawn Debnath To: Robert Haas CC: Thomas Munro , Tom Lane , Andres Freund , Dmitry Dolgov <9erthalion6@gmail.com>, PostgreSQL-development Subject: Re: Refactoring the checkpointer's fsync request queue Message-ID: <20190326164758.GA78630@f01898859afd.ant.amazon.com> References: <20190305160715.GA26468@f01898859afd.ant.amazon.com> <3127.1551804796@sss.pgh.pa.us> <20190305171557.GA30015@f01898859afd.ant.amazon.com> <20190313010007.GB8301@f01898859afd.ant.amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-Originating-IP: [10.43.162.111] X-ClientProxiedBy: EX13D11UWB002.ant.amazon.com (10.43.161.20) To EX13D05UWC002.ant.amazon.com (10.43.162.92) Precedence: Bulk List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Mar 26, 2019 at 09:22:56AM -0400, Robert Haas wrote: > On Tue, Mar 26, 2019 at 12:20 AM Thomas Munro wrote: > > I've been trying to decide if that is a problem. Maybe there is a > > performance angle, and I'm also wondering if it might increase the > > risk of missing a write-back error. Of course we'll find a proper > > solution to that problem (perhaps fd-passing or sync-on-close[1]), but > > I don't want to commit anything in the name of refactoring that might > > make matters worse incidentally. Or perhaps those worries are bogus, > > since the checkpointer calls smgrcloseall() at the end anyway. > > > > On balance, I'm inclined to err on the side of caution and try to keep > > things a bit closer to the way they are for now. > > > > Here's a fixup patch. 0001 is the same as Shawn's v12 patch, and 0002 > > has my proposed changes to switch to callbacks that actually perform > > the sync and unlink operations given a file tag, and do so via the > > SMGR fd cache, rather than exposing the path to sync.c. This moves us > > back towards the way I had it in an earlier version of the patch, but > > instead of using smgrsyncimmed() as I had it, it goes via Shawn's new > > sync handler function lookup table, allowing for non-smgr components > > to use this machinery in future (as requested by Andres). > > Strong +1. Not only might closing and reopening the files have > performance and reliability implications, but a future smgr might talk > to the network, having no local file to sync. Makes sense for now. When we re-visit the fd-passing or sync-on-close implementations, we can adapt the changes relatively easily given the rest of the framework is staying intact. I am hoping these patches do not delay the last fsync-gate issue discussion further. -- Shawn Debnath Amazon Web Services (AWS)