pgsql: Remove unnecessary call to ReadCheckpointRecord(). - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Remove unnecessary call to ReadCheckpointRecord().
Date
Msg-id E1m9RmL-0007SR-HP@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1d919de5eb3fffa7cc9479ed6d2915fb89794459

Modified Files
--------------
src/backend/access/transam/xlog.c | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: pgsql: Use --no-loop for new calls of pg_receivewal --endpos in TAP tes
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Re-enable TAP tests of pg_receivewal for ZLIB on Windows