Remove unnecessary call to ReadCheckpointRecord().
authorRobert Haas <[email protected]>
Fri, 30 Jul 2021 12:33:33 +0000 (08:33 -0400)
committerRobert Haas <[email protected]>
Fri, 30 Jul 2021 12:35:13 +0000 (08:35 -0400)
commit1d919de5eb3fffa7cc9479ed6d2915fb89794459
tree40ec3dc654f2984b08206610f7c7ce95e80e0635
parent3df93a66593c344e6298e618df3fa5090fca4309
Remove unnecessary call to ReadCheckpointRecord().

It should always be the case that the last checkpoint record is still
readable, because otherwise, a crash would leave us in a situation
from which we can't recover. Therefore the test removed by this patch
should always succeed. For it to fail, either there has to be a serious
bug in the code someplace, or the user has to be manually modifying
pg_wal while crash recovery is running. If it's the first one, we
should fix the bug. If it's the second one, they should stop, or
anyway they're doing so at their own risk. In neither case does
a full checkpoint instead of an end-of-recovery record seem like a
clear winner. Furthermore, rarely-taken code paths are particularly
vulnerable to bugs, so let's simplify by getting rid of this one.

Discussion: http://postgr.es/m/CA+TgmoYmw==TOJ6EzYb_vcjyS09NkzrVKSyBKUUyo1zBEaJASA@mail.gmail.com
src/backend/access/transam/xlog.c