postgres.git / summary / log / commit / refs

commit    d8718edf6017ba647abb2715d6196ca53bb3aec6
Author:   Alvaro Herrera <alvherre@alvh.no-ip.org>
Date:     Wed Mar 23 18:23:51 2022 +0000
First released in: 15.0, 10.21, 11.16, 12.11, 13.7, 14.3

    pg_upgrade: Upgrade an Assert to a real 'if' test
    
    It seems possible for the condition being tested to be true in
    production, and nobody would never know (except when some data
    eventually becomes corrupt?).
    
    Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
    Discussion: https://postgr.es/m//202109040001.zky3wgv2qeqg@alvherre.pgsql


src/bin/pg_rewind/parsexlog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c index 85dd32c5681..6f6f7a43b3c 100644 --- a/src/bin/pg_rewind/parsexlog.c +++ b/src/bin/pg_rewind/parsexlog.c @@ -105,7 +105,11 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex, * If 'endpoint' didn't point exactly at a record boundary, the caller * messed up. */ - Assert(xlogreader->EndRecPtr == endpoint); + if (xlogreader->EndRecPtr != endpoint) + pg_fatal("end pointer %X/%X is not a valid end point; expected %X/%X", + (uint32) (endpoint >> 32), (uint32) (endpoint), + (uint32) (xlogreader->EndRecPtr >> 32), (uint32) + (xlogreader->EndRecPtr)); XLogReaderFree(xlogreader); if (xlogreadfd != -1) [parent: 9ade3c09a5d1]