pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@lists.postgresql.org, Robert Haas <robertmhaas@gmail.com>
Subject: Re: Non-emergency patch for bug #17679
Date: Tue, 08 Nov 2022 15:40:43 -0500
Message-ID: <3824194.1667940043@sss.pgh.pa.us> (raw)
In-Reply-To: <20221108203117.2qalrihg3circg3o@awork3.anarazel.de>
References: <3797575.1667924888@sss.pgh.pa.us>
	<20221108203117.2qalrihg3circg3o@awork3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2022-11-08 11:28:08 -0500, Tom Lane wrote:
>> Hence, the attached reverts everything 4ab5dae94 did to this function,
>> and most of 0e758ae89 too, and instead makes IsBinaryUpgrade an
>> additional reason to take the immediate-unlink path.

> I wonder if it's worth aiming slightly higher. There's plenty duplicated code
> between the first segment handling and the loop body. Perhaps the if at the
> top just should decide whether to unlink the first segment or not, and we then
> check that in the body of the loop for segno == 0?

I don't care for that.  I think the point here is precisely that
we want behavior A for the first segment and behavior B for the
remaining ones, and so I'd prefer to keep the code that does A
and the code that does B distinct.  It was a misguided attempt to
share that code that got us into trouble here in the first place.
Moreover, any future changes to either behavior will be that much
harder if we combine the implementations.

			regards, tom lane





view thread (3+ messages)

Message-ID: <3824194.1667940043@sss.pgh.pa.us>
Permalink:  ../3824194.1667940043@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3824194.1667940043@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, robertmhaas@gmail.com
  Subject: Re: Non-emergency patch for bug #17679
  In-Reply-To: <3824194.1667940043@sss.pgh.pa.us>
  References: <3797575.1667924888@sss.pgh.pa.us> <20221108203117.2qalrihg3circg3o@awork3.anarazel.de> <3824194.1667940043@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox