]> granicus.if.org Git - postgresql/commitdiff
Print WAL position correctly in pg_rewind error message.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 30 Jul 2019 18:14:14 +0000 (21:14 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 30 Jul 2019 18:14:51 +0000 (21:14 +0300)
This has been wrong ever since pg_rewind was added. The if-branch just
above this, where we print the same error with an extra message supplied
by XLogReadRecord() got this right, but the variable name was wrong in the
else-branch. As a consequence, the error printed the WAL position as
0/0 if there was an error reading a WAL file.

Backpatch to 9.5, where pg_rewind was added.

src/bin/pg_rewind/parsexlog.c

index 2081cf8bd3342ffa4a7c62c3dd40bd7a07723ba0..a5d1a5dddde5a4e83fe732ba108455c1eec4aea6 100644 (file)
@@ -89,8 +89,7 @@ extractPageMap(const char *datadir, XLogRecPtr startpoint, TimeLineID tli,
                                                 errormsg);
                        else
                                pg_fatal("could not read WAL record at %X/%X\n",
-                                                (uint32) (startpoint >> 32),
-                                                (uint32) (startpoint));
+                                                (uint32) (errptr >> 32), (uint32) (errptr));
                }
 
                extractPageInfo(xlogreader);