diff --git a/src/gausskernel/process/postmaster/postmaster.cpp b/src/gausskernel/process/postmaster/postmaster.cpp index 55052a18d..f4b39d64f 100755 --- a/src/gausskernel/process/postmaster/postmaster.cpp +++ b/src/gausskernel/process/postmaster/postmaster.cpp @@ -2785,12 +2785,16 @@ static int ServerLoop(void) } /* If we have lost the archiver, try to start a new one */ - if (XLogArchivingActive() && g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode) { - if (pmState == PM_RUN || pmState == PM_HOT_STANDBY || pmState == PM_RECOVERY) { + if (XLogArchivingActive() && g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode){ + if (pmState == PM_RUN) { g_instance.pid_cxt.PgArchPID = pgarch_start(); + } else if (pmState == PM_HOT_STANDBY) { + obs_slot = getObsReplicationSlot(); + if (obs_slot != NULL) { + g_instance.pid_cxt.PgArchPID = pgarch_start(); + } } } - /* If we have lost the stats collector, try to start a new one */ if (g_instance.pid_cxt.PgStatPID == 0 && (pmState == PM_RUN || pmState == PM_HOT_STANDBY) && !dummyStandbyMode) g_instance.pid_cxt.PgStatPID = pgstat_start(); diff --git a/src/gausskernel/storage/replication/walreceiver.cpp b/src/gausskernel/storage/replication/walreceiver.cpp index 91756473a..283ed7dd3 100644 --- a/src/gausskernel/storage/replication/walreceiver.cpp +++ b/src/gausskernel/storage/replication/walreceiver.cpp @@ -125,10 +125,8 @@ const char *g_reserve_param[RESERVE_SIZE] = { "archive_dest", #ifndef ENABLE_MULTIPLE_NODES "recovery_min_apply_delay", - "archive_mode", "sync_config_strategy" #else - NULL, NULL, NULL #endif diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index 46728566f..619a96253 100644 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -3197,6 +3197,7 @@ static int WalSndLoop(WalSndSendDataCallback send_data) /* Check for input from the client */ ProcessRepliesIfAny(); +#ifdef ENABLE_MULTIPLE_NODES /* Only the primary can send the archive lsn to standby */ load_server_mode(); if (t_thrd.xlog_cxt.server_mode == PRIMARY_MODE && IsValidArchiverStandby(t_thrd.walsender_cxt.MyWalSnd)) { @@ -3230,6 +3231,7 @@ static int WalSndLoop(WalSndSendDataCallback send_data) WalSndSendArchiveLsn2Standby(t_thrd.walsender_cxt.MyWalSnd->arch_task_lsn); pg_atomic_write_u32(standby_archive_flag, 0); } +#endif /* Walsender first startup, send a keepalive to standby, no need reply. */ if (first_startup) { diff --git a/src/include/knl/knl_thread.h b/src/include/knl/knl_thread.h index 48ef97bad..a6b061e1b 100644 --- a/src/include/knl/knl_thread.h +++ b/src/include/knl/knl_thread.h @@ -67,7 +67,7 @@ #include "pgxc/barrier.h" #define MAX_PATH_LEN 1024 -#define RESERVE_SIZE 36 +#define RESERVE_SIZE 35 typedef struct ResourceOwnerData* ResourceOwner;