forked from huawei/openGauss-server
commit
61cd9e6bcc
|
|
@ -1157,7 +1157,7 @@ static void initLastTaskLsn()
|
|||
t_thrd.arch.last_arch_time = TIME_GET_MILLISEC(tv);
|
||||
volatile ReplicationSlot* obs_archive_slot = getObsReplicationSlot();
|
||||
if (obs_archive_slot != NULL && !IsServerModeStandby()) {
|
||||
XLogRecPtr targetLsn = getRestartLsnFromSlot();
|
||||
targetLsn = getRestartLsnFromSlot();
|
||||
if (targetLsn != InvalidXLogRecPtr) {
|
||||
t_thrd.arch.pitr_task_last_lsn = targetLsn;
|
||||
advanceObsSlot(t_thrd.arch.pitr_task_last_lsn);
|
||||
|
|
|
|||
|
|
@ -260,6 +260,14 @@ void StartupProcessMain(void)
|
|||
StartupXLOG();
|
||||
}
|
||||
|
||||
/*
|
||||
* If the archiver is still alive, we need to restart the archiver in startup.
|
||||
*/
|
||||
if (g_instance.pid_cxt.PgArchPID != 0 && getObsReplicationSlot() != NULL) {
|
||||
gs_signal_send(g_instance.pid_cxt.PgArchPID, SIGTERM);
|
||||
gs_signal_send(g_instance.pid_cxt.PgArchPID, SIGUSR2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit normally. Exit code 0 tells postmaster that we completed recovery
|
||||
* successfully.
|
||||
|
|
|
|||
|
|
@ -1943,7 +1943,7 @@ void advanceObsSlot(XLogRecPtr restart_pos)
|
|||
gettimeofday(&tv, NULL);
|
||||
long current = TIME_GET_MILLISEC(tv);
|
||||
long diff = current - t_thrd.arch.last_advance_slot_time;
|
||||
if (diff > t_thrd.arch.advance_slot_wait_interval) {
|
||||
if (diff > t_thrd.arch.advance_slot_wait_interval && t_thrd.xlog_cxt.server_mode == PRIMARY_MODE) {
|
||||
flushSlot(current);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -856,8 +856,7 @@ void redo_slot_advance(const ReplicationSlotPersistentData *slotInfo)
|
|||
* for logical replication slot, the Slot->data.database is VALID.
|
||||
*/
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
if (IsReplicationSlotActive(NameStr(slotInfo->name)) && t_thrd.slot_cxt.MyReplicationSlot != NULL &&
|
||||
t_thrd.slot_cxt.MyReplicationSlot->data.database != InvalidOid) {
|
||||
if (IsReplicationSlotActive(NameStr(slotInfo->name)) && slotInfo->database != InvalidOid) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue