diff options
author | Andres Freund | 2015-01-03 19:51:52 +0000 |
---|---|---|
committer | Andres Freund | 2015-01-03 19:54:12 +0000 |
commit | 2c0a4858965f1375dadb45df9f3a054bfcb283f5 (patch) | |
tree | 554010c06211d68cfe87377cc599385c29355019 /src/bin/pg_basebackup/pg_receivexlog.c | |
parent | ccb161b66addc9d0ede31359c05f7e9df61ab8d4 (diff) |
Prevent WAL files created by pg_basebackup -x/X from being archived again.
WAL (and timeline history) files created by pg_basebackup did not
maintain the new base backup's archive status. That's currently not a
problem if the new node is used as a standby - but if that node is
promoted all still existing files can get archived again. With a high
wal_keep_segment settings that can happen a significant time later -
which is quite confusing.
Change both the backend (for the -x/-X fetch case) and pg_basebackup
(for -X stream) itself to always mark WAL/timeline files included in
the base backup as .done. That's in line with walreceiver.c doing so.
The verbosity of the pg_basebackup changes show pretty clearly that it
needs some refactoring, but that'd result in not be backpatchable
changes.
Backpatch to 9.1 where pg_basebackup was introduced.
Discussion: [email protected]
Diffstat (limited to 'src/bin/pg_basebackup/pg_receivexlog.c')
-rw-r--r-- | src/bin/pg_basebackup/pg_receivexlog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c index 4658f080f34..b10da73dc58 100644 --- a/src/bin/pg_basebackup/pg_receivexlog.c +++ b/src/bin/pg_basebackup/pg_receivexlog.c @@ -342,7 +342,7 @@ StreamLog(void) ReceiveXlogStream(conn, startpos, starttli, NULL, basedir, stop_streaming, standby_message_timeout, ".partial", - synchronous); + synchronous, false); PQfinish(conn); conn = NULL; |