Re: standby promotion can create unreadable WAL - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: standby promotion can create unreadable WAL
Date
Msg-id 20220826140611.oub3tsegdmbaw4on@alvherre.pgsql
Whole thread Raw
In response to Re: standby promotion can create unreadable WAL  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: standby promotion can create unreadable WAL
List pgsql-hackers
On 2022-Aug-26, Robert Haas wrote:

> I agree. Testing StandbyMode here seems bogus. I thought initially
> that the test should perhaps be for InArchiveRecovery rather than
> ArchiveRecoveryRequested, but I see that the code which switches to a
> new timeline cares about ArchiveRecoveryRequested, so I think that is
> the correct thing to test here as well.

Yeah, I think you had already established elsewhere that testing
StandbyMode was the wrong thing to do.  Testing ArchiveRecoveryRequested
here seems quite odd at first, but given the copying behavior, I agree
that it seems a correct thing to do.

There's a small typo in the comment: "When find that".  I suppose that
was meant to be "When we find that".  You end that para with "and thus
we should not do this", but that sounds like it wouldn't matter if we
did.  Maybe "and thus doing this would be wrong, so skip it." or
something like that.  (Perhaps be even more specific and say "if we did
this, we would later create an overwrite record in the wrong place,
breaking everything")

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Strip -mmacosx-version-min options from plperl build
Next
From: Benjamin Coutu
Date:
Subject: Re: Insertion Sort Improvements