Add missing check for wal_debug GUC.
authorAndres Freund <andres@anarazel.de>
Wed, 10 Jun 2015 11:04:57 +0000 (13:04 +0200)
committerAndres Freund <andres@anarazel.de>
Wed, 10 Jun 2015 13:07:15 +0000 (15:07 +0200)
9a20a9b2 added a new elog(), enabled when WAL_DEBUG is defined. The
other WAL_DEBUG dependant messages check for the wal_debug GUC, but this
one did not.

Backpatch to 9.4, the first release containing 9a20a9b2.

src/backend/access/transam/xlog.c

index 150d56afb8fc341b585ef6947bebc02b132aa2ae..80389ba8e1fc9bec4344b007e0833e9d393b647e 100644 (file)
@@ -1983,7 +1983,7 @@ AdvanceXLInsertBuffer(XLogRecPtr upto, bool opportunistic)
    LWLockRelease(WALBufMappingLock);
 
 #ifdef WAL_DEBUG
-   if (npages > 0)
+   if (XLOG_DEBUG && npages > 0)
    {
        elog(DEBUG1, "initialized %d pages, upto %X/%X",
             npages, (uint32) (NewPageEndPtr >> 32), (uint32) NewPageEndPtr);