aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-11-06 21:24:40 +0900
committerFujii Masao <fujii@postgresql.org>2014-11-06 21:24:40 +0900
commit5332b8cec54192c5d7b0ad67dc5668ccb917eeef (patch)
treea8abe41f1d01b5641cd77c7f2b82dd5c44a32fa1 /src/backend/access
parent2076db2aea766c4c828dccc34ae35f614129000d (diff)
downloadpostgresql-5332b8cec54192c5d7b0ad67dc5668ccb917eeef.tar.gz
postgresql-5332b8cec54192c5d7b0ad67dc5668ccb917eeef.zip
Prevent the unnecessary creation of .ready file for the timeline history file.
Previously .ready file was created for the timeline history file at the end of an archive recovery even when WAL archiving was not enabled. This creation is unnecessary and causes .ready file to remain infinitely. This commit changes an archive recovery so that it creates .ready file for the timeline history file only when WAL archiving is enabled. Backpatch to all supported versions.
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/transam/timeline.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c
index 2d27b3ae318..50e64882b8c 100644
--- a/src/backend/access/transam/timeline.c
+++ b/src/backend/access/transam/timeline.c
@@ -36,6 +36,7 @@
#include <unistd.h>
#include "access/timeline.h"
+#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlogdefs.h"
#include "storage/fd.h"
@@ -437,8 +438,11 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
#endif
/* The history file can be archived immediately. */
- TLHistoryFileName(histfname, newTLI);
- XLogArchiveNotify(histfname);
+ if (XLogArchivingActive())
+ {
+ TLHistoryFileName(histfname, newTLI);
+ XLogArchiveNotify(histfname);
+ }
}
/*