pgsql: Remove unnecessary call to ReadCheckpointRecord().

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove unnecessary call to ReadCheckpointRecord().
Date: 2021-07-30 12:38:17
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-07-30 12:40:12 Re: pgsql: Re-enable TAP tests of pg_receivewal for ZLIB on Windows
Previous Message Michael Paquier 2021-07-30 12:29:27 pgsql: Use --no-loop for new calls of pg_receivewal --endpos in TAP tes