Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers

From: zengman <zengman(at)halodbtech(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers
Date: 2026-02-04 01:50:52
Message-ID: tencent_1551583C3514085A5A461E15@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>> I think we should reject this as useless code churn. The parameter
>>> was needed in the past and might be needed again in the future.
>>> It's fairly common for other AtEOXact functions to take an isCommit
>>> flag, so I don't find it surprising for these to have one.
>>
>> +1
>
>+1. Symmetry is usually relevant in the signature of these cleanup
>functions.

Hi all,

I still want to do this simple cleanup, and I’d like to state my thoughts:

1. It has been a very long time, about more than twenty years, since the `isCommit` parameter of `AtEOXact_LocalBuffers` last functioned, namely commit fdd13f156814f81732c188788ab1b7b14c59f4da.

2. This modification mainly involves `AtEOXact_Buffers`. Judging from the comment, the work undertaken by this function seems simple and stable.
```
/*
* AtEOXact_Buffers - clean up at end of transaction.
*
* As of PostgreSQL 8.0, buffer pins should get released by the
* ResourceOwner mechanism. This routine is just a debugging
* cross-check that no pins remain.
*/
void
AtEOXact_Buffers(bool isCommit)
{
CheckForBufferLeaks();

AtEOXact_LocalBuffers(isCommit);

Assert(PrivateRefCountOverflowed == 0);
}
```
3. Some other AtEOXact functions take no parameters, although this is not a strong argument here.

However, I understand everyone's thoughts and respect your opinions, so I choose to keep my own opinion on this.

--
regards,
Man Zeng

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-02-04 01:55:47 Re: Add expressions to pg_restore_extended_stats()
Previous Message David G. Johnston 2026-02-04 01:46:22 Re: Add LIMIT option to COPY FROM