Re: Remove unused function parameters, part 2: replication - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Remove unused function parameters, part 2: replication
Date
Msg-id ks5ihuwevqzqjmdmejuhyqwhlzvqp2d3x5eyda5gs5naa2jncq@3uct3xefn4yl
Whole thread Raw
In response to Remove unused function parameters, part 2: replication  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Remove unused function parameters, part 2: replication
List 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



pgsql-hackers by date:

Previous
From: KENAN YILMAZ
Date:
Subject: Re: Bypassing cursors in postgres_fdw to enable parallel plans
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Periodic authorization expiration checks using GoAway message