Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ca26c64

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 98eb3e0 commit ca26c64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bin/pg_rewind/parsexlog.c

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

106110
XLogReaderFree(xlogreader);
107111
if (xlogreadfd != -1)

0 commit comments

Comments
 (0)