]> granicus.if.org Git - postgresql/commitdiff
Don't abort pg_basebackup when receiving empty WAL block
authorMagnus Hagander <magnus@hagander.net>
Mon, 11 Nov 2013 13:34:06 +0000 (14:34 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 11 Nov 2013 13:34:06 +0000 (14:34 +0100)
This can happen exactly at the switch of a logical WAL file
(segment number ending in FE), when running pg_basebackup connected
to a standby server, and would cause the backup to abort with
the error message "streaming header too small".

There is nothing wrong with an empty message, it's just unnecessary,
and the rest of the code can handle the case of an empty message,
so this patch just removes the error condition when the size is
exactly zero.

src/bin/pg_basebackup/receivelog.c

index 98c4b7a1e597253ddadd9f4cbcb84e58a1e7dacc..71791d3e29bd2b4a5b221e5c120faaf4e8227f59 100644 (file)
@@ -495,7 +495,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
                                        progname, copybuf[0]);
                        goto error;
                }
-               if (r < STREAMING_HEADER_SIZE + 1)
+               if (r < STREAMING_HEADER_SIZE)
                {
                        fprintf(stderr, _("%s: streaming header too small: %d\n"),
                                        progname, r);