From: Fujii Masao Date: Thu, 6 Nov 2014 12:25:45 +0000 (+0900) Subject: Prevent the unnecessary creation of .ready file for the timeline history file. X-Git-Tag: REL9_2_10~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38eb5d9e86af67953bad91dd5b9d993b076b37bf;p=postgresql 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. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index ff1ee86896..5a6b2a389e 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4877,8 +4877,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); + } } /*