diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-03-23 19:23:51 +0100 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2022-03-23 19:23:51 +0100 |
commit | 9814c708c657a9f21fd1a36b5dc0f49ca2d01499 (patch) | |
tree | d0987afb1ba0394483b31ce25cc214de03064b5b | |
parent | caaeb88ff7ae84a3bbf0ee497a4bda18cf9261cd (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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c index 59ebac7d6aa..b9351291fe7 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) |