mirror of
https://github.com/postgres/postgres.git
synced 2026-01-05 23:38:41 +03:00
Avoid archiving XLOG_RUNNING_XACTS on idle server
If archive_timeout > 0 we should avoid logging XLOG_RUNNING_XACTS if idle. Bug 13685 reported by Laurence Rowe, investigated in detail by Michael Paquier, though this is not his proposed fix. 20151016203031.3019.72930@wrigleys.postgresql.org Simple non-invasive patch to allow later backpatch to 9.4 and 9.5
This commit is contained in:
@@ -330,8 +330,11 @@ BackgroundWriterMain(void)
|
||||
if (now >= timeout &&
|
||||
last_snapshot_lsn != GetXLogInsertRecPtr())
|
||||
{
|
||||
last_snapshot_lsn = LogStandbySnapshot();
|
||||
XLogRecPtr log_standby_lsn = LogStandbySnapshot();
|
||||
|
||||
last_snapshot_ts = now;
|
||||
if (!XLogRecPtrIsInvalid(log_standby_lsn))
|
||||
last_snapshot_lsn = log_standby_lsn;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user