aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2016-12-27 10:37:11 +0100
committerMagnus Hagander <magnus@hagander.net>2016-12-27 10:37:11 +0100
commit3ea56fffd66fe2c5857f36359ae16d4cabcdeef6 (patch)
tree881813a58cdbaf9366697adbaad07eb5d1d2b4d8
parent6cfa54e384700d4a2124e5c4d7a1eb91e8e0eeb7 (diff)
downloadpostgresql-3ea56fffd66fe2c5857f36359ae16d4cabcdeef6.tar.gz
postgresql-3ea56fffd66fe2c5857f36359ae16d4cabcdeef6.zip
Don't rename .partial files in pg_receivexlog if an error occured
In 56c7d8d the behavior to keep .partial segments around (considered corrupt) in case an connection failure occurs was accidentally removed. This would lead to an incomplete segment being considered complete. Author: Michael Paquier
-rw-r--r--src/bin/pg_basebackup/receivelog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 4382e5d76a1..568ff176ef5 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -679,7 +679,7 @@ ReceiveXlogStream(PGconn *conn, StreamCtl *stream)
}
error:
- if (walfile != NULL && stream->walmethod->close(walfile, CLOSE_NORMAL) != 0)
+ if (walfile != NULL && stream->walmethod->close(walfile, CLOSE_NO_RENAME) != 0)
fprintf(stderr, _("%s: could not close file \"%s\": %s\n"),
progname, current_walfile_name, stream->walmethod->getlasterror());
walfile = NULL;