Remove unused isCommit parameter from AtEOXact_LocalBuffers - Mailing list pgsql-hackers

From zengman
Subject Remove unused isCommit parameter from AtEOXact_LocalBuffers
Date
Msg-id tencent_17B13D9206FD633428A9DA3A@qq.com
Whole thread Raw
Responses Re: Remove unused isCommit parameter from AtEOXact_LocalBuffers
List pgsql-hackers
Hi all,

I see the `isCommit` parameter of `AtEOXact_LocalBuffers` is unused:
```
void
AtEOXact_LocalBuffers(bool isCommit)
{
    CheckForLocalBufferLeaks();
}
```

Commit 5df307c7782518c4a3c19ffd05c7cb591b97e23c introduced `AtEOXact_LocalBuffers(bool isCommit)` for the following
logic:
```
            if (isCommit)
                elog(WARNING,
                     "local buffer leak: [%03d] (rel=%u/%u/%u, blockNum=%u, flags=0x%x, refcount=%u %d)",
                     i,
                     buf->tag.rnode.spcNode, buf->tag.rnode.dbNode,
                   buf->tag.rnode.relNode, buf->tag.blockNum, buf->flags,
                     buf->refcount, LocalRefCount[i]);
```
Commit fdd13f156814f81732c188788ab1b7b14c59f4da removed the above code, but the `isCommit` parameter was left intact. 

I intend to remove this unused parameter, and also clean up the call site in `AtEOXact_Buffers` since it invokes
`AtEOXact_LocalBuffers`.

The code contains multiple calls to `AtEOXact_Buffers`, some of which pass `false` and others pass `true`, which may be
confusing.

Attached is the patch for these changes.

--
regards,
Man Zeng
Attachment

pgsql-hackers by date:

Previous
From: KAZAR Ayoub
Date:
Subject: Re: Speed up COPY FROM text/CSV parsing using SIMD
Next
From: Roman Khapov
Date:
Subject: Re: Additional message in pg_terminate_backend