Re: Is WAL_DEBUG related code still relevant today?

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is WAL_DEBUG related code still relevant today?
Date: 2023-12-06 11:27:17
Message-ID: 5a2e43da-0425-4fc1-9b13-19fd33123950@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Make-WAL_DEBUG-code-harder-to-break-accidentally.patch text/plain 5.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2023-12-06 12:31:59 Re: Make COPY format extendable: Extract COPY TO format implementations
Previous Message shveta malik 2023-12-06 11:23:24 Re: Synchronizing slots from primary to standby