Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers

Поиск
Список
Период
Сортировка
От zengman
Тема Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers
Дата
Msg-id tencent_1551583C3514085A5A461E15@qq.com
обсуждение исходный текст
Ответ на Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers  (Michael Paquier <michael@paquier.xyz>)
Список 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
seemssimple 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

В списке pgsql-hackers по дате отправления: