summaryrefslogtreecommitdiff
path: root/src/include/postmaster
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-05-08 21:59:01 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-05-08 21:59:01 +0300
commitde7688442f5aaa03da60416a6aa3474738718803 (patch)
treea78779f832365b8b3dad8a9485c9b99c9b775a9e /src/include/postmaster
parent179cdd098196338880bdbb39c39a788abdad4dd8 (diff)
downloadpostgresql-de7688442f5aaa03da60416a6aa3474738718803.tar.gz
At promotion, archive last segment from old timeline with .partial suffix.
Previously, we would archive the possible-incomplete WAL segment with its normal filename, but that causes trouble if the server owning that timeline is still running, and tries to archive the same segment later. It's not nice for the standby to trip up the master's archival like that. And it's pretty confusing, anyway, to have an incomplete segment in the archive that's indistinguishable from a normal, complete segment. To avoid such confusion, add a .partial suffix to the file. Or to be more precise, make a copy of the old segment under the .partial suffix, and archive that instead of the original file. pg_receivexlog also uses the .partial suffix for the same purpose, to tell apart incompletely streamed files from complete ones. There is no automatic mechanism to use the .partial files at recovery, so they will go unused, unless the administrator manually copies to them to the pg_xlog directory (and removes the .partial suffix). Recovery won't normally need the WAL - when recovering to the new timeline, it will find the same WAL on the first segment on the new timeline instead - but it nevertheless feels better to archive the file with the .partial suffix, for debugging purposes if nothing else.
Diffstat (limited to 'src/include/postmaster')
-rw-r--r--src/include/postmaster/pgarch.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/postmaster/pgarch.h b/src/include/postmaster/pgarch.h
index 9f692eb47f..425e2ab4f0 100644
--- a/src/include/postmaster/pgarch.h
+++ b/src/include/postmaster/pgarch.h
@@ -24,7 +24,7 @@
*/
#define MIN_XFN_CHARS 16
#define MAX_XFN_CHARS 40
-#define VALID_XFN_CHARS "0123456789ABCDEF.history.backup"
+#define VALID_XFN_CHARS "0123456789ABCDEF.history.backup.partial"
/* ----------
* Functions called from postmaster