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 | ca26c64581b529b2191757dbb27b94c6b0c101be (patch) | |
tree | 80ef56bdcb40181bca9e91a8b5e7c19ad58d9b0a /src | |
parent | 98eb3e06ce3a628adabeb90584c002a3c4bcec8e (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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/parsexlog.c b/src/bin/pg_rewind/parsexlog.c index 1a67725ec04..cb1bdc958d3 100644 --- a/src/bin/pg_rewind/parsexlog.c +++ b/src/bin/pg_rewind/parsexlog.c @@ -101,7 +101,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) |