Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbaGe-00CSHT-5G for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Aug 2023 05:30:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qbaGc-004DFc-Vd for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Aug 2023 05:30:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbaGb-004DEi-GN for pgsql-hackers@lists.postgresql.org; Thu, 31 Aug 2023 05:30:54 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbaGW-0024KT-D5 for pgsql-hackers@postgresql.org; Thu, 31 Aug 2023 05:30:52 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id B4FE93200902; Thu, 31 Aug 2023 01:30:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 31 Aug 2023 01:30:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1693459843; x=1693546243; bh=Gr tcukyU3Cr4Qmm2Y/06rKhblNuiPE01lTQbtpwFptY=; b=V97KKdox/KaV2JTyrn IZ4XqSM7DArSIpq3zfgJ07NIje1dkVNpkhuB3szKryoNRDryxme16s3TFBtP1WMg VkReG/+YQeun2ZUKeCAwTW9WIxmSIopGfTE1PQO6QRHRG1ipClK/q6j5hrS2TdCa KmSE5fONkloREi5PzHVMvjTuXDzaK5TD1jA7GLOcrQsUCWz5B+UPtrVxDoIoMiAx prr2i3G+nGcvmS6suHkhgB7yP0OouX2mz6U8UGD2Q9kyVrOKcu212e/u7f9sYEfo 23a8Q2fGaCfxHk3ZyJ7xDZ7YWpaPtUvOCK5i5jkkShBrQc0yVo6EmwmfTaUoVfoo T7hg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693459843; x=1693546243; bh=GrtcukyU3Cr4Q mm2Y/06rKhblNuiPE01lTQbtpwFptY=; b=TSrSywXLpZUD2HVR+j6gftDp1u8qj r2FlUpbe/qLS+wguMBWFJpk6yxnQJQVtSCnXl70eLeaAL1edl6rfuoiXPeXCrXD6 vndFTovNLVR5jUJcbceeqo5J35WlATrqe79UpYIzCgRLNQ2S09KjKZ/51cyENyCV 9I4wm7LW5TJ1l4apiI9UuoOdbb68z9Tm9xIe7UdlWNZBJN4OGfLvyn1vtEn1H0rt jKXzHd5jMckZHzLz+mMYk+qE36ySJjRR7Ewbslyn/zbMEj4QLL632SSmKfrn0mvt gIr+/+IbWy3l60XTJmpCTjarP/U5sOP3cxjb5ciRkTrg0pyjOwFei9+aw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefledgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Aug 2023 01:30:37 -0400 (EDT) Date: Thu, 31 Aug 2023 14:30:33 +0900 From: Michael Paquier To: Nathan Bossart Cc: Justin Pryzby , Thomas Munro , David Steele , Fujii Masao , Bruce Momjian , Tom Lane , Michael Brown , pgsql-hackers@postgresql.org Subject: Re: should frontend tools use syncfs() ? Message-ID: References: <20230818160111.GA189711@nathanxps13> <20230822014407.GA449131@nathanxps13> <20230822020632.GA565843@nathanxps13> <20230822171110.GA711171@nathanxps13> <20230829154559.GA2136737@nathanxps13> <20230830011408.GA2269049@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ArDQUYwRnuxAr60f" Content-Disposition: inline In-Reply-To: <20230830011408.GA2269049@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ArDQUYwRnuxAr60f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Aug 29, 2023 at 06:14:08PM -0700, Nathan Bossart wrote: > That seems fair enough. I did this in v7. I restructured fsync_pgdata() > and fsync_dir_recurse() so that any new sync methods should cause compiler > warnings until they are implemented. That's pretty cool and easier to maintain in the long term. After sleeping on it, there are two things that popped up in my mind that may be worth considering: - Should we have some regression tests? We should only need one test in one of the binaries to be able to stress the new code paths of file_utils.c with syncfs. The cheapest one may be pg_dump with a dump in directory format? Note that we have tests there that depend on lz4 or gzip existing, which are conditional. - Perhaps 0002 should be split into two parts? The first patch could introduce DataDirSyncMethod in file_utils.h with the new routines in file_utils.h (including syncfs support), and the second patch would plug the new option to all the binaries. In the first patch, I would hardcode DATA_DIR_SYNC_METHOD_FSYNC. -- Michael --ArDQUYwRnuxAr60f Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmTwJXkACgkQnvQgOdby QH2hIA//UXbRET6H2xjnYSKICNC91owdcNhAjjiDY6swiIu9CZFZCcBDZ5lr3dnI 2KjVRuY8zlv93y43ok/KrPyderkaNeZVHJsg3Ojrkj7Qbc7BBBBHDMQke+vPHrxa Ud8D1NzV1ThY5l4E+rquDUVEvd2wV7sLPox2NuMPEXREnFqjewEoY+gKkJMLzhQJ AyRbl3ku7opdsu81K+lcNmi1SCDn7wxPfFA1kqKxToCGZWLndU+XG2YfgCcCblA7 NyKziGWd6GmV+ynCaUTe8L7W6/1in4du0cnQtw4DSR6WuD6XCTbs6C4bhAoj80Uw l0Obe1wG3SX7GvYFoxcCMI1kOZJNP6v7TuzV7f2ntn7ZNEkb/S2DC5Sltd6lZQ00 ssojhHiEtm8f3LZ72p+iIqJkWWMHYGfMrHTD5bnac6fWABVWs5bkv17E+PRo+74J CXIwkQu33yX31S/hOZhCikhQCPH7m8w6dAZyDCdgl8mLBCE22iV3EamfP6kNoRnl eTunLzM/JvY5MyO2v3OZsZeeNSYQmG2+kGqqZCWjAWHSHTB0YlzQ+NhTFcE9mQfO aO/RhbosgeXKTNrPO7z2OPfHEXJcY9BSarYGpSjP7ZlQevaw3K7ZT+30bj/OH54a lvP0CdFwtTjYjh8k3iXG7NdUeHLIxBKW2beoqz3WjjDIJw/i4wg= =FmuV -----END PGP SIGNATURE----- --ArDQUYwRnuxAr60f--