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 1of9VW-0007t8-Ua for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Oct 2022 00:40:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1of9VV-0004e6-Da for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Oct 2022 00:40:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1of9VT-0004dx-TM for pgsql-hackers@lists.postgresql.org; Mon, 03 Oct 2022 00:40:29 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1of9VR-0002hW-T1 for pgsql-hackers@lists.postgresql.org; Mon, 03 Oct 2022 00:40:27 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 6DC045C00A6; Sun, 2 Oct 2022 20:40:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 02 Oct 2022 20:40:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; 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=fm2; t=1664757624; x=1664844024; bh=N93hGssNHX lHvjCzaPG5TV642R4DmXeNnjIqnywSpuA=; b=eWu4Ux9qSjrHKEBZiFZW1u4k4W LAdWsv3D2xfqkdZOl+dBAq4c1kkMUhbRDlsHexQSL/uTfPErZhnJrLrDQKZlvuhw DhG2f0KW+tqT+MBgkRT+tjqpLJzDKcIxV21dOwKBAbZbjRYpPF5Xcxvkk2oqqumm PaivJGqment4O9/b5Q+BrTVciEeZZaUoRgR3bxy1P3Bboo8DUqHXnBRGEvKhtnTX kzo8pFV4k/vlO0uACrYsqJLEw9zAIaWKtrtj6GH9mh6DQC0EKv5tRurRDAUFYXXk kNS1bg6gXgiQJN2YIJi/tTeD/u5bcatL4G7BEnqq8rtzFZUy1TPoJNcHIgag== 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= fm2; t=1664757624; x=1664844024; bh=N93hGssNHXlHvjCzaPG5TV642R4D mXeNnjIqnywSpuA=; b=aB0GE8T1Vr7ymHfcTjsB4A4axRzSn97F0ZIvfsuITi4P Qf+2gJKGLWGbjdqtsIwjYQYKsSKpkqj+2nBdOs/dBD6SUoxWBg3orfu+WDoqaFUw IoN6lIIKTtGeaXu5xj1G2wQ/rpAHLHW0xtH1mn6ow/DWzhbd2V+alZ+xCAC/b2VF cEaeMQQLgBl8I94e/mjT50FSdRXCIzgCzPGpQohuscfv1emCmhukW3EkDaeRcpVB cHFhJShu6gxKYW1iwICmHJdbEf6QTxGTvfpLuoxV1V2prCPDMU1Kexyv9psEK0su BA5XtM4CUATg6QsCAi9wvC++82ZBr+v2Pmj74xrMNw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehkedgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 2 Oct 2022 20:40:22 -0400 (EDT) Date: Mon, 3 Oct 2022 09:40:20 +0900 From: Michael Paquier To: Thomas Munro Cc: Justin Pryzby , Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade test failure Message-ID: References: <20220919213217.ptqfdlcc5idk5xup@awork3.anarazel.de> <20220920013122.GA31833@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0sVtsBD4PEjwXGZU" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0sVtsBD4PEjwXGZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 03, 2022 at 12:10:06PM +1300, Thomas Munro wrote: > I think something like the attached should do the right thing for > STATUS_DELETE_PENDING (sort of "ENOENT-in-progress"). unlink() goes > back to being blocking (sleep+retry until eventually we reach ENOENT > or we time out and give up with EACCES), but we still distinguish it > from true ENOENT so we have a fast exit in that case. This is passing > CI, but not tested yet. if (lstat(path, &st) < 0) - return -1; + { + if (lstat_error_was_status_delete_pending()) + is_lnk = false; + else + return -1; + } + else + is_lnk = S_ISLNK(st.st_mode); Sorry, I don't remember all the details in this area, but a directory can never be marked as STATUS_DELETE_PENDING with some of its contents still inside, right? If it has some contents, forcing unlink() all the time would be fine? > One ugly thing in this patch is that it has to deal with our > historical mistake (?) of including Windows headers in this file in > Cygwin builds for no reason and thus getting WIN32 defined on a > non-WIN32 build, as I've complained about before[1] but not yet tidied > up. Your proposal remains local to dirmod.c, so that does not sound like a big deal to me for the time being. -- Michael --0sVtsBD4PEjwXGZU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmM6L3QACgkQnvQgOdby QH2oaRAAqoxoTfvjxyEPbi3oAACTli0ju7u6BKe/2WaNtArFbKmva7IKwQ6hMtJr ame5E8nxHKWxikmPA3qO33+4TXgdUbJhXCD3pE8yKgkennOA5L78oyvTbYjfUiIG 0u1DiijRfn94sxC/5RT0g5m+dC4se7ogm7ZqvrCjG1ZF6zLwRajfr/43HuyqBId1 1FgAf+83ex5yReHEwcxMjmaot0FDDUEBIgQWi7iqHUP0N8Zy84fM/9WX1wxo1vRz 88HWO8R4FvrtzUyzdzIhUBK90zfebpiI1ved+TNjdt/m9aomQ0aSqxpaN14yZBnO 27WCbM5e657tgTMllIW8n+S6gZNEYHjecPCOpc+iX4uaFl8ltBmi9zgyGu+Ck9JW zVHUbu28LeFkL3xRwadsgQ8ORa37ZeipjahQPE0NwmAlTG32fDTpCTPZMB7D+fAn /4Wbg5R/abPgZAt69rLtcHrmXeiZD8D/DjPRuEmzw88QOAM3PdloDX1EF84Z041O XuRwhoPg+o9u/7906q/AoeFm9zQrJtW2sHY5pdQdQ0NEGryEhMy12QK7hIuldpmP lHhhyuQJOKV34LJbsr6hhEIU0nDpcjqdX2J4gydQs+nrzBpspZMj3i4yKgDSx+AU 3ZfIW1vEMJ41GawV97pTBTkQ1sT1Ujx0yD566RoncUFzf/0qd/k= =KrrW -----END PGP SIGNATURE----- --0sVtsBD4PEjwXGZU--