Merge branch 'standby_archive' of https://gitee.com/luo_zihao5524/openGauss-server into standby_archive
This commit is contained in:
@ -127,6 +127,7 @@ static void initLastTaskLsn();
|
|||||||
static bool SendArchiveThreadStatusInternal(bool is_archive_activited);
|
static bool SendArchiveThreadStatusInternal(bool is_archive_activited);
|
||||||
static void SendArchiveThreadStatus(bool status);
|
static void SendArchiveThreadStatus(bool status);
|
||||||
static bool NotifyPrimaryArchiverActived(ThreadId* last_walrcv_pid, bool* sent_archive_status);
|
static bool NotifyPrimaryArchiverActived(ThreadId* last_walrcv_pid, bool* sent_archive_status);
|
||||||
|
static void NotifyPrimaryArchiverShutdown(bool sent_archive_status);
|
||||||
static void ChangeArchiveTaskStatus2Done();
|
static void ChangeArchiveTaskStatus2Done();
|
||||||
|
|
||||||
AlarmCheckResult DataInstArchChecker(Alarm* alarm, AlarmAdditionalParam* additionalParam)
|
AlarmCheckResult DataInstArchChecker(Alarm* alarm, AlarmAdditionalParam* additionalParam)
|
||||||
@ -368,6 +369,7 @@ static void pgarch_MainLoop(void)
|
|||||||
t_thrd.arch.got_SIGHUP = false;
|
t_thrd.arch.got_SIGHUP = false;
|
||||||
ProcessConfigFile(PGC_SIGHUP);
|
ProcessConfigFile(PGC_SIGHUP);
|
||||||
if (!XLogArchivingActive()) {
|
if (!XLogArchivingActive()) {
|
||||||
|
NotifyPrimaryArchiverShutdown(sent_archive_status);
|
||||||
ereport(LOG, (errmsg("PgArchiver exit")));
|
ereport(LOG, (errmsg("PgArchiver exit")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -511,9 +513,7 @@ static void pgarch_MainLoop(void)
|
|||||||
* in the loop, the sent_archive_status will be set to true. We don't need to send the archive status when
|
* in the loop, the sent_archive_status will be set to true. We don't need to send the archive status when
|
||||||
* the sent_archive_status is false, so we don't need to check the version number in this step.
|
* the sent_archive_status is false, so we don't need to check the version number in this step.
|
||||||
*/
|
*/
|
||||||
if (sent_archive_status) {
|
NotifyPrimaryArchiverShutdown(sent_archive_status);
|
||||||
SendArchiveThreadStatus(ARCHIVE_OFF);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1224,6 +1224,13 @@ static bool NotifyPrimaryArchiverActived(ThreadId* last_walrcv_pid, bool* sent_a
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void NotifyPrimaryArchiverShutdown(bool sent_archive_status)
|
||||||
|
{
|
||||||
|
if (sent_archive_status) {
|
||||||
|
SendArchiveThreadStatus(ARCHIVE_OFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void ChangeArchiveTaskStatus2Done()
|
static void ChangeArchiveTaskStatus2Done()
|
||||||
{
|
{
|
||||||
if (IsServerModeStandby()) {
|
if (IsServerModeStandby()) {
|
||||||
|
@ -152,14 +152,14 @@ static void XLogWalRcvWrite(WalRcvCtlBlock *walrcb, char *buf, Size nbytes, XLog
|
|||||||
errmsg("could not close log file %s: %m",
|
errmsg("could not close log file %s: %m",
|
||||||
XLogFileNameP(t_thrd.xlog_cxt.ThisTimeLineID, recvSegNo))));
|
XLogFileNameP(t_thrd.xlog_cxt.ThisTimeLineID, recvSegNo))));
|
||||||
|
|
||||||
|
#ifdef ENABLE_MULTIPLE_NODES
|
||||||
/*
|
/*
|
||||||
* Create .done file forcibly to prevent the restored segment from
|
* Create .done file forcibly to prevent the restored segment from
|
||||||
* being archived again later.
|
* being archived again later.
|
||||||
*/
|
*/
|
||||||
XLogFileName(xlogfname, recvFileTLI, recvSegNo);
|
XLogFileName(xlogfname, recvFileTLI, recvSegNo);
|
||||||
if (!u_sess->attr.attr_common.XLogArchiveMode) {
|
XLogArchiveForceDone(xlogfname);
|
||||||
XLogArchiveForceDone(xlogfname);
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
recvFile = -1;
|
recvFile = -1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user