Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGA33-0004lr-7u for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 02:44:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pGA32-0000GU-04 for pgsql-hackers@arkaria.postgresql.org; Fri, 13 Jan 2023 02:44:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGA30-0000Ed-VD for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 02:44:03 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGA2y-0007ya-6V for pgsql-hackers@lists.postgresql.org; Fri, 13 Jan 2023 02:44:01 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EB6FB5C0136; Thu, 12 Jan 2023 21:43:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 12 Jan 2023 21:43:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc: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=fm3; t=1673577836; x=1673664236; bh=Yl8mfVPjRf jnQ0tXgIs3pmEqQOtxU7lZAtBs57FXEFQ=; b=uwrXdJPy0QUlQp2U3kZCXY8dTH xUQoIF8NyNke1LuI4vPZTob5+JiIZ7l4ASY3zzJVuOyMnlvxaEcgVtFzz0F5Sh54 Xgi7XACYF6dq4Due/IS4ZCrqTdTtuo+M/mKm01qMRcMxIn1iIE0KnNAGBbRUBvHw E1u0PClbYH5qDtPt1wtXR9ncsKYmO0lh+ZJ0j5mYA3R4VR14D9JHUhlG3sc48TLC WzJ3ETegZ4TBmzPFVH6JRfQw1glL5AmQBytElxYCGV6DmlaOafIKq4mm0Bj5TmXg /Wrk3gYXycGzz1ggMn5zddmzAba3TrU8XkhXiAw7p/bFv/9rw+f3Q2qV8WcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= fm3; t=1673577836; x=1673664236; bh=Yl8mfVPjRfjnQ0tXgIs3pmEqQOtx U7lZAtBs57FXEFQ=; b=U1buZByvI6CbralOaMrlBTVmbMv2/cJHtHbplCWn8Ngd LuMMDi5lG4yZj5Q6BiTRUVR39eR3a22xhctTEH+mYl6738GTKsuAEbC4sWWlRqdN Oye+DkyIfruyoShma+NeDEHQvlKihLW6YoZibQ7T3i1Kjfb3VPo2bhFX9gdT9Bju JjBXgQCDcrEtWX5vc7GYoav46V3g7s2flEH/rVBWK0RV3LoAm70zCJYqACHTDlKR zk6iVRvP5L8w2SruASH5x10dod4fhLjeN2vzUypuxYdxheEX2OxJ2AVDVjmXupSg pt6jL2p4K2LELoTNZWhQp9O9a/cjdV3P4NWaDxzFbw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleejgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteevudei tedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 21:43:55 -0500 (EST) Date: Thu, 12 Jan 2023 18:43:54 -0800 From: Andres Freund To: Justin Pryzby Cc: Thomas Munro , vignesh C , pgsql-hackers@lists.postgresql.org, Andrew Dunstan , Tom Lane Subject: Re: Cygwin cleanup Message-ID: <20230113024354.3q4aigbf4fyh2igg@awork3.anarazel.de> References: <20220804033828.GK19644@telsasoft.com> <20221021034040.GT16921@telsasoft.com> <20221109010437.GK3775@telsasoft.com> <20230103142537.GM1153@telsasoft.com> <20230112043949.GQ9837@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112043949.GQ9837@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-11 22:39:49 -0600, Justin Pryzby wrote: > Thomas raised a good question, which was how the tests were passing when > SnapBuildSerialize() was raising an error, which is what it would've > been doing when I used data_sync_retry=no. Presumably some test not checking for failures in a part of the test. > So .. why is wal_sync_method being used to control fsync for things > other than WAL? Historical raisins, I think. The problem is that macOS lies about fsync, and one needs special magic to make it behave like a real fsync. Somebody thought that instead of inventing a separate GUC to control whether the "real" fsync is used for other subsystems, it'd be better to reuse wal_sync_method. Note that this isn't the function that is actually used for WAL (that's issue_xlog_fsync()), and that pg_fsync() only uses the GUC to know whether to use pg_fsync_writethrough() or pg_fsync_no_writethrough(fd). > See 6dc7760ac (c. 2005) which added wal_fsync_writethrough, at which > point (since 9b178555f, c. 2004) wal_sync_method was already being used > for SLOG. > > Now, it's also being used for logical decoding (since b89e1510 and > 858ec1185, c. 2014) in rewriteheap.c/snapbuild.c. And pidfiles (since > ee0e525bf, 2010). And the control file (8b938d36f7, 2019). Note that > data_sync_retry wasn't added until 9ccdd7f66 (c. 2018) > > It looks like logical decoding may be the "most wrong" place that > wal_sync_method is being used, so maybe my change is reasonable to > consider, and not just a workaround. I don't follow. What does using fsync_fname() vs fsync_fname_ext() have to do with pg_fsync() using wal_sync_method? fsync_fname() is just a wrapper around fsync_fname_ext(). Both end up in pg_fsync(). Are you actually proposing that we don't PANIC after an fsync for the category of files that you list here, even with data_sync_retry set? Greetings, Andres Freund