Revert bf08f2292ffca14fd133aa0901d1563b6ecd6894
authorSimon Riggs <[email protected]>
Wed, 6 Apr 2016 13:03:46 +0000 (14:03 +0100)
committerSimon Riggs <[email protected]>
Wed, 6 Apr 2016 13:03:46 +0000 (14:03 +0100)
Remove recent changes to logging XLOG_RUNNING_XACTS by request.

src/backend/postmaster/bgwriter.c
src/backend/storage/ipc/standby.c

index 654e4f8bd5762802111a5e06233862cff9c95cfa..00f03d8acbe7ba54b4fc91aa28c80f2c508850fb 100644 (file)
@@ -330,11 +330,8 @@ BackgroundWriterMain(void)
            if (now >= timeout &&
                last_snapshot_lsn != GetXLogInsertRecPtr())
            {
-               XLogRecPtr log_standby_lsn = LogStandbySnapshot();
-
+               last_snapshot_lsn = LogStandbySnapshot();
                last_snapshot_ts = now;
-               if (!XLogRecPtrIsInvalid(log_standby_lsn))
-                   last_snapshot_lsn = log_standby_lsn;
            }
        }
 
index 8b9b438ca929c1cae5ced8985d91cd45e5a5d294..6a9bf842d3923affc66e251dcd277afcab1ec7e9 100644 (file)
@@ -902,7 +902,6 @@ LogStandbySnapshot(void)
    RunningTransactions running;
    xl_standby_lock *locks;
    int         nlocks;
-   static bool last_snapshot_overflowed = false;
 
    Assert(XLogStandbyInfoActive());
 
@@ -933,28 +932,8 @@ LogStandbySnapshot(void)
     * only a shared lock.
     */
    if (wal_level < WAL_LEVEL_LOGICAL)
-   {
        LWLockRelease(ProcArrayLock);
 
-       /*
-        * Don't bother to log anything if nothing is happening, if we are
-        * using archive_timeout > 0 and we didn't overflow snapshot last time.
-        *
-        * This ensures that we don't issue an empty WAL record, which can
-        * be annoying when used in conjunction with archive timeout.
-        */
-       if (running->xcnt == 0 &&
-           nlocks == 0 &&
-           XLogArchiveTimeout > 0 &&
-           !last_snapshot_overflowed)
-       {
-           LWLockRelease(XidGenLock);
-           return InvalidXLogRecPtr;
-       }
-
-       last_snapshot_overflowed = running->subxid_overflow;
-   }
-
    recptr = LogCurrentRunningXacts(running);
 
    /* Release lock if we kept it longer ... */