diff --git a/src/gausskernel/process/postmaster/bgwriter.cpp b/src/gausskernel/process/postmaster/bgwriter.cpp index 76854a57f..d1af8b3a5 100755 --- a/src/gausskernel/process/postmaster/bgwriter.cpp +++ b/src/gausskernel/process/postmaster/bgwriter.cpp @@ -350,7 +350,8 @@ void BackgroundWriterMain(void) * time. E.g. Checkpointer, when active, is barely ever in its * mainloop and thus makes it hard to log regularly. */ - if (XLogStandbyInfoActive() && !RecoveryInProgress()) { + if (XLogStandbyInfoActive() && !RecoveryInProgress() && + (!SS_DISASTER_CLUSTER || SS_DISASTER_CLUSTER && SS_PRIMARY_MODE)) { TimestampTz timeout = 0; TimestampTz now = GetCurrentTimestamp(); timeout = TimestampTzPlusMilliseconds(last_snapshot_ts, LOG_SNAPSHOT_INTERVAL_MS); diff --git a/src/gausskernel/storage/access/transam/xloginsert.cpp b/src/gausskernel/storage/access/transam/xloginsert.cpp index e3d6309da..20a1e645c 100755 --- a/src/gausskernel/storage/access/transam/xloginsert.cpp +++ b/src/gausskernel/storage/access/transam/xloginsert.cpp @@ -87,6 +87,11 @@ void XLogBeginInsert(void) Assert(t_thrd.xlog_cxt.mainrdata_len == 0); Assert(!(SS_CLUSTER_ONDEMAND_RECOVERY && SS_STANDBY_MODE)); + if (SS_STANDBY_MODE) { + ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("instance is in standby mode"), + errhint("standby node cannot make new WAL entries in shared storage mode."))); + } + /* cross-check on whether we should be here or not */ if (!XLogInsertAllowed()) ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), errmsg("recovery is in progress"),