Re: Remove unused function parameters, part 2: replication

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-11-28T17:14:08Z
Lists: pgsql-hackers
Hi,

On 2025-11-28 09:24:23 +0000, Bertrand Drouvot wrote:
> PFA a patch to remove unused function parameters in replication (means
> focusing on src/backend/replication).
> 
> Those have been detected by a coccinelle script (that I need to polish before
> sharing). It currently only focuses on static functions.

Maybe I'm just a bit grumpy this morning, but what do we gain by changes like
this?


> While reviewing the coccinelle script output, I did a bit of Archeology to know
> where the oversights come from (which helps with review), and that gives:
>
> [...]
> ReorderBuffer *rb in ReorderBufferRestoreCleanup(): b89e151054a0
> ReorderBuffer *rb in ReorderBufferMaybeMarkTXNStreamed(): 072ee847ad4c
> ReplicationSlot *slot in ReorderBufferSerializedPath(): 8aa75e1384b1
> ReorderBuffer *rb in ReorderBufferFreeSnap(): b89e151054a0
> TransactionId xid in ReorderBufferReplay(): a271a1b50e9b

I don't think these are oversights. They intentionally get the reorderbuffer,
it's an implementation detail that the *txn argument happens to currently be
sufficient.


> Oid relid in ApplyLogicalMappingFile(): b89e151054a0

Same, except it's in parallel to UpdateLogicalMappings().

Greetings,

Andres Freund