forked from huawei/openGauss-server
禁用备机归档
This commit is contained in:
parent
8725ceff6e
commit
aedb48e7e1
|
|
@ -2781,12 +2781,16 @@ static int ServerLoop(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we have lost the archiver, try to start a new one */
|
/* If we have lost the archiver, try to start a new one */
|
||||||
if (XLogArchivingActive() && g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode) {
|
if (XLogArchivingActive() && g_instance.pid_cxt.PgArchPID == 0 && !dummyStandbyMode){
|
||||||
if (pmState == PM_RUN || pmState == PM_HOT_STANDBY || pmState == PM_RECOVERY) {
|
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();
|
g_instance.pid_cxt.PgArchPID = pgarch_start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* If we have lost the stats collector, try to start a new one */
|
/* 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)
|
if (g_instance.pid_cxt.PgStatPID == 0 && (pmState == PM_RUN || pmState == PM_HOT_STANDBY) && !dummyStandbyMode)
|
||||||
g_instance.pid_cxt.PgStatPID = pgstat_start();
|
g_instance.pid_cxt.PgStatPID = pgstat_start();
|
||||||
|
|
|
||||||
|
|
@ -125,10 +125,8 @@ const char *g_reserve_param[RESERVE_SIZE] = {
|
||||||
"archive_dest",
|
"archive_dest",
|
||||||
#ifndef ENABLE_MULTIPLE_NODES
|
#ifndef ENABLE_MULTIPLE_NODES
|
||||||
"recovery_min_apply_delay",
|
"recovery_min_apply_delay",
|
||||||
"archive_mode",
|
|
||||||
"sync_config_strategy"
|
"sync_config_strategy"
|
||||||
#else
|
#else
|
||||||
NULL,
|
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -3203,6 +3203,7 @@ static int WalSndLoop(WalSndSendDataCallback send_data)
|
||||||
/* Check for input from the client */
|
/* Check for input from the client */
|
||||||
ProcessRepliesIfAny();
|
ProcessRepliesIfAny();
|
||||||
|
|
||||||
|
#ifdef ENABLE_MULTIPLE_NODES
|
||||||
/* Only the primary can send the archive lsn to standby */
|
/* Only the primary can send the archive lsn to standby */
|
||||||
load_server_mode();
|
load_server_mode();
|
||||||
if (t_thrd.xlog_cxt.server_mode == PRIMARY_MODE && IsValidArchiverStandby(t_thrd.walsender_cxt.MyWalSnd)) {
|
if (t_thrd.xlog_cxt.server_mode == PRIMARY_MODE && IsValidArchiverStandby(t_thrd.walsender_cxt.MyWalSnd)) {
|
||||||
|
|
@ -3236,6 +3237,7 @@ static int WalSndLoop(WalSndSendDataCallback send_data)
|
||||||
WalSndSendArchiveLsn2Standby(t_thrd.walsender_cxt.MyWalSnd->arch_task_lsn);
|
WalSndSendArchiveLsn2Standby(t_thrd.walsender_cxt.MyWalSnd->arch_task_lsn);
|
||||||
pg_atomic_write_u32(standby_archive_flag, 0);
|
pg_atomic_write_u32(standby_archive_flag, 0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Walsender first startup, send a keepalive to standby, no need reply. */
|
/* Walsender first startup, send a keepalive to standby, no need reply. */
|
||||||
if (first_startup) {
|
if (first_startup) {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
#include "pgxc/barrier.h"
|
#include "pgxc/barrier.h"
|
||||||
#define MAX_PATH_LEN 1024
|
#define MAX_PATH_LEN 1024
|
||||||
|
|
||||||
#define RESERVE_SIZE 36
|
#define RESERVE_SIZE 35
|
||||||
|
|
||||||
typedef struct ResourceOwnerData* ResourceOwner;
|
typedef struct ResourceOwnerData* ResourceOwner;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue