summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2022-03-23 19:23:51 +0100
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2022-03-23 19:23:51 +0100
commitd8718edf6017ba647abb2715d6196ca53bb3aec6 (patch)
treeb14b3afbab239b78d82ed96014a41973739f04d1 /src
parent9ade3c09a5d11f4be91b5e180832abd2dbc2c55d (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_rewind/parsexlog.c6
1 files changed, 5 insertions, 1 deletions
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)