summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlogarchive.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/xlogarchive.c')
-rw-r--r--src/backend/access/transam/xlogarchive.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/access/transam/xlogarchive.c b/src/backend/access/transam/xlogarchive.c
index 7d56dad0def..e9ca3aa48b2 100644
--- a/src/backend/access/transam/xlogarchive.c
+++ b/src/backend/access/transam/xlogarchive.c
@@ -489,6 +489,20 @@ XLogArchiveNotify(const char *xlog)
return;
}
+ /*
+ * Timeline history files are given the highest archival priority to
+ * lower the chance that a promoted standby will choose a timeline that
+ * is already in use. However, the archiver ordinarily tries to gather
+ * multiple files to archive from each scan of the archive_status
+ * directory, which means that newly created timeline history files
+ * could be left unarchived for a while. To ensure that the archiver
+ * picks up timeline history files as soon as possible, we force the
+ * archiver to scan the archive_status directory the next time it looks
+ * for a file to archive.
+ */
+ if (IsTLHistoryFileName(xlog))
+ PgArchForceDirScan();
+
/* Notify archiver that it's got something to do */
if (IsUnderPostmaster)
PgArchWakeup();