Re: Is WAL_DEBUG related code still relevant today? - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Is WAL_DEBUG related code still relevant today?
Date
Msg-id 5a2e43da-0425-4fc1-9b13-19fd33123950@eisentraut.org
Whole thread Raw
In response to Is WAL_DEBUG related code still relevant today?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Is WAL_DEBUG related code still relevant today?
Re: Is WAL_DEBUG related code still relevant today?
List pgsql-hackers
On 02.12.23 15:06, Bharath Rupireddy wrote:
> I enabled this code by compiling with the WAL_DEBUG macro and setting
> wal_debug GUC to on. Firstly, the compilation on Windows failed
> because XL_ROUTINE was passed inappropriately for XLogReaderAllocate()
> used.

This kind of thing could be mostly avoided if we didn't hide all the 
WAL_DEBUG behind #ifdefs.  For example, in the attached patch, I instead 
changed it so that

     if (XLOG_DEBUG)

resolves to

     if (false)

in the normal case.  That way, we don't need to wrap that in #ifdef 
WAL_DEBUG, and the compiler can see the disabled code and make sure it 
continues to build.

Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: Synchronizing slots from primary to standby
Next
From: "Daniel Verite"
Date:
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations