]> 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:26:15 +0000 (21:26 +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 c7bdd617b2645e42977402c0715d1a2d553d8566..dafd7f679195b2028e53a29b4ed4642e5ea45564 100644 (file)
@@ -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);
+       }
 }
 
 /*