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 1kEwGH-0003yE-2S for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Sep 2020 15:07:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kEwGF-0007xY-Ps for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Sep 2020 15:07:19 +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 1kEwGF-0007xR-IY for pgsql-hackers@lists.postgresql.org; Sun, 06 Sep 2020 15:07:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEwG8-00048a-A3 for pgsql-hackers@lists.postgresql.org; Sun, 06 Sep 2020 15:07:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 086F6xiT1364692; Sun, 6 Sep 2020 11:06:59 -0400 From: Tom Lane To: Heikki Linnakangas cc: pgsql-hackers@lists.postgresql.org Subject: Re: Dubious code in pg_rewind's process_target_file() In-reply-to: <6ba44dc9-2b7e-1988-de4e-99832235eae5@iki.fi> References: <1221796.1599329320@sss.pgh.pa.us> <1222282.1599329909@sss.pgh.pa.us> <6ba44dc9-2b7e-1988-de4e-99832235eae5@iki.fi> Comments: In-reply-to Heikki Linnakangas message dated "Sun, 06 Sep 2020 17:54:22 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1364690.1599404819.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 06 Sep 2020 11:06:59 -0400 Message-ID: <1364691.1599404819@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Heikki Linnakangas writes: > On 05/09/2020 21:18, Tom Lane wrote: >> Or actually, maybe we should just drop the lstat call altogether? > Agreed, the lstat() doesn't do anything interesting. > This is refactored away by the patches discussed at = > https://www.postgresql.org/message-id/f155aab5-1323-8d0c-9e3b-32703124bf= 00%40iki.fi. = > But maybe we should still clean it up in the back-branches. Ah, I'd not been paying much attention to that work, but I see you are getting rid of the lstat(). I propose to remove the lstat() in the back branches, but not touch HEAD so as not to cause extra merge effort for your patch. regards, tom lane