| From: | zengman <zengman(at)halodbtech(dot)com> |
|---|---|
| To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Remove unused isCommit parameter from AtEOXact_LocalBuffers |
| Date: | 2026-02-03 12:08:29 |
| Message-ID: | tencent_17B13D9206FD633428A9DA3A@qq.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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 | Content-Type | Size |
|---|---|---|
| 0001-Refactor-AtEOXact_Buffers-and-AtEOXact_LocalBuffers-.patch | application/octet-stream | 5.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Roman Khapov | 2026-02-03 12:28:50 | Re: Additional message in pg_terminate_backend |
| Previous Message | KAZAR Ayoub | 2026-02-03 12:06:19 | Re: Speed up COPY FROM text/CSV parsing using SIMD |