修复备机存在写xlog问题
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user