]> granicus.if.org Git - postgresql/commitdiff
Prevent the unnecessary creation of .ready file for the timeline history file.
authorFujii Masao <fujii@postgresql.org>
Thu, 6 Nov 2014 12:25:45 +0000 (21:25 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 6 Nov 2014 12:25:45 +0000 (21:25 +0900)
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.

src/backend/access/transam/xlog.c

index ff1ee8689686ca3f7121a236214c7d8e618fc755..5a6b2a389e0d30d320d3aa337e80d6bbaa01fd62 100644 (file)
@@ -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);
+       }
 }
 
 /*