Commit 5332b8ce authored by Fujii Masao's avatar Fujii Masao

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.
parent 2076db2a
......@@ -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);
}
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment