aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2014-11-06 21:25:45 +0900
committerFujii Masao <fujii@postgresql.org>2014-11-06 21:26:15 +0900
commit4e746807408eadad9ad13692464f381fde1c3fbd (patch)
tree022135f2697c7c2631bf6f836a8cf396b0809d72
parent7225abf00ec6728c371edea8817af483fc760dff (diff)
downloadpostgresql-4e746807408eadad9ad13692464f381fde1c3fbd.tar.gz
postgresql-4e746807408eadad9ad13692464f381fde1c3fbd.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.
-rw-r--r--src/backend/access/transam/xlog.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index c7bdd617b26..dafd7f67919 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4615,8 +4615,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);
+ }
}
/*