Content-Length: 260375 | pFad | http://github.com/postgrespro/postgres/commit/3e1c942a4e2f06e9b0196180eb8fd1383e6d788e

CD pg_upgrade: Upgrade an Assert to a real 'if' test · postgrespro/postgres@3e1c942 · GitHub
Skip to content

Commit 3e1c942

Browse files
committed
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
1 parent 5917671 commit 3e1c942

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bin/pg_rewind/parsexlog.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex,
102102
* If 'endpoint' didn't point exactly at a record boundary, the caller
103103
* messed up.
104104
*/
105-
Assert(xlogreader->EndRecPtr == endpoint);
105+
if (xlogreader->EndRecPtr != endpoint)
106+
pg_fatal("end pointer %X/%X is not a valid end point; expected %X/%X",
107+
LSN_FORMAT_ARGS(endpoint), LSN_FORMAT_ARGS(xlogreader->EndRecPtr));
106108

107109
XLogReaderFree(xlogreader);
108110
if (xlogreadfd != -1)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/3e1c942a4e2f06e9b0196180eb8fd1383e6d788e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy