Re: xlog.c: removing ReadRecPtr and EndRecPtr - Mailing list pgsql-hackers

From Robert Haas
Subject Re: xlog.c: removing ReadRecPtr and EndRecPtr
Date
Msg-id CA+TgmoawnisDpedsEDSEnytQOGDYqKpXi3GR7MdU_DSbRJ=3HA@mail.gmail.com
Whole thread Raw
In response to xlog.c: removing ReadRecPtr and EndRecPtr  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: xlog.c: removing ReadRecPtr and EndRecPtr
List pgsql-hackers
On Wed, Nov 17, 2021 at 5:01 PM Robert Haas <robertmhaas@gmail.com> wrote:
> In rescanLatestTimeLine(), the problem is IMHO probably serious enough
> to justify a separate commit with back-patching.

On second thought, I think it's better not to back-patch this fix. It
turns out that, while it's easy enough to back-patch the proposed
patch, it doesn't make the test case pass in pre-v14 versions. The
test case itself requires some changes to work at all because of the
perl module renaming, but that's not a big deal. The issue is that, in
the back-branches, when starting up the server without any local WAL,
rescanLatestTimeLine() is checking with not only the wrong LSN but
also with the wrong TLI. That got fixed in master by commit
4a92a1c3d1c361ffb031ed05bf65b801241d7cdd even though, rather
unfortunately, the commit message does not say so. So to back-patch
this commit we would need to also back-patch much of that commit. But
that commit depends on the other commits that reduced use of
ThisTimeLineID. Untangling that seems like an undue amount of work and
risk for a corner-case bug fix that was discovered in the lab rather
than in the field and which won't matter anyway if you do things
correctly. So now I'm intending to commit to just to master only.

Attached please find the test case not for commit as
v2-0001-dubious-test-case.patch; the fix, for commit and now with a
proper commit message as
v2-0002-Fix-corner-case-failure-to-detect-improper-timeli.patch; and
the back-ported test case for v14 as v14-0001-dubious-test-case.patch
in case anyone wants to play around with that. (with apologies for
using the idea of a version number in two different and conflicting
senses)

-- 
Robert Haas
EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Post-CVE Wishlist
Next
From: Jacob Champion
Date:
Subject: Re: pg_upgrade parallelism