summaryrefslogtreecommitdiff
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
commit3e1c942a4e2f06e9b0196180eb8fd1383e6d788e (patch)
tree65334c9dfecb1b7e86e30511d7971f56c48c4d98
parent591767150f5f91ccc3614e71977c47ce7a68786b (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
-rw-r--r--src/bin/pg_rewind/parsexlog.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c
index 7cfa169e9b9..3ed2a2e811e 100644
--- a/src/bin/pg_rewind/parsexlog.c
+++ b/src/bin/pg_rewind/parsexlog.c
@@ -102,7 +102,9 @@ 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",
+ LSN_FORMAT_ARGS(endpoint), LSN_FORMAT_ARGS(xlogreader->EndRecPtr));
XLogReaderFree(xlogreader);
if (xlogreadfd != -1)