On 2021-Nov-25, Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
>
> > The problem is that the bug occurs while writing the WAL record. Fixed
> > servers won't produce such records, but if you run an unpatched server
> > and it happens to write one, without a mitigation you cannot get away
> > from FATAL during replay.
>
> Really? AFAICS the WAL record contains the correct value, or at least
> we should define that one as being correct, for precisely this reason.
I don't know what is the correct value for a record that comes exactly
after the page header. But here's a patch that fixes the problem; and
if a standby replays WAL written by an unpatched primary, it will be
able to read past instead of dying of FATAL.
I originally wrote this to have a WARNING in VerifyOverwriteContrecord
(in the cases that are new), with the idea that it'd prompt people to
upgrade, but that's probably a waste of time.
--
Álvaro Herrera Valdivia, Chile — https://www.EnterpriseDB.com/
"El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)