Re: Is WAL_DEBUG related code still relevant today?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-12-06T15:06:17Z
Lists: pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes: > 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. Hmm, maybe, but I'm not sure this would be an unalloyed good. The main concern I have is compilers and static analyzers starting to bleat about unreachable code (warnings like "variable set but never used", or the like, seem plausible). The dead code would also decrease our code coverage statistics, not that those are wonderful now. regards, tom lane
Commits
-
Remove trace_recovery_messages
- c7a3e6b46d38 17.0 landed
-
Fix compilation on Windows with WAL_DEBUG
- 7d5a740331bf 13.14 landed
- c49b6cab1e66 14.11 landed
- 87ed81a8739b 15.6 landed
- 6248a2bb92cc 16.2 landed
- 7636725b922c 17.0 landed