Don't abort pg_basebackup when receiving empty WAL block

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.
This commit is contained in:
Magnus Hagander 2013-11-11 14:34:06 +01:00
parent 9a45a65597
commit c6ec8793aa

View File

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