Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e0c76b

Browse files
committed
pg_upgrade: Upgrade an Assert to a real 'if' test
It seems possible for the condition being tested to be true inproduction, and nobody would never know (except when some dataeventually becomes corrupt?).Author: Álvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://postgr.es/m//202109040001.zky3wgv2qeqg@alvherre.pgsql
1 parentc714ebd commit8e0c76b

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
@@ -105,7 +105,11 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, int tliIndex,
105105
* If 'endpoint' didn't point exactly at a record boundary, the caller
106106
* messed up.
107107
*/
108-
Assert(xlogreader->EndRecPtr==endpoint);
108+
if (xlogreader->EndRecPtr!=endpoint)
109+
pg_fatal("end pointer %X/%X is not a valid end point; expected %X/%X",
110+
(uint32) (endpoint >>32), (uint32) (endpoint),
111+
(uint32) (xlogreader->EndRecPtr >>32), (uint32)
112+
(xlogreader->EndRecPtr));
109113

110114
XLogReaderFree(xlogreader);
111115
if (xlogreadfd!=-1)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp