diff options
author | Fujii Masao <fujii@postgresql.org> | 2014-11-06 21:24:40 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2014-11-06 21:25:18 +0900 |
commit | 3a3b7e316f85566771d3a28ea874e030fb12126b (patch) | |
tree | e7d0ac20b6aa887ba2da1d9075fa740d0de2b88f | |
parent | 0247935c7b44526a2051184963b76cdd62ea0ab8 (diff) | |
download | postgresql-3a3b7e316f85566771d3a28ea874e030fb12126b.tar.gz postgresql-3a3b7e316f85566771d3a28ea874e030fb12126b.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/timeline.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/access/transam/timeline.c b/src/backend/access/transam/timeline.c index 0f34c17e1f6..200808f7771 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); + } } /* |