Re: bufmgr: pass through I/O stats context in FlushUnlockedBuffer()
Melanie Plageman <melanieplageman@gmail.com>
From: Melanie Plageman <melanieplageman@gmail.com>
To: Chao Li <li.evan.chao@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>,
Andres Freund <andres@anarazel.de>
Date: 2026-04-21T21:52:35Z
Lists: pgsql-hackers
On Tue, Mar 31, 2026 at 10:15 PM Chao Li <li.evan.chao@gmail.com> wrote:
>
> I noticed that FlushUnlockedBuffer() accepts io_object and io_context, but then ignores them and hardcodes IOOBJECT_RELATIONand IOCONTEXT_NORMAL instead:
> ```
> static void
> FlushUnlockedBuffer(BufferDesc *buf, SMgrRelation reln,
> IOObject io_object, IOContext io_context)
> {
> Buffer buffer = BufferDescriptorGetBuffer(buf);
>
> BufferLockAcquire(buffer, buf, BUFFER_LOCK_SHARE_EXCLUSIVE);
> FlushBuffer(buf, reln, IOOBJECT_RELATION, IOCONTEXT_NORMAL); // <== HERE
> BufferLockUnlock(buffer, buf);
> }
> ```
>
> Unless I am missing something, if a function accepts these parameters, they should generally be used.
Thanks for the patch. Committed in 31b0544b32b
- Melanie
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
bufmgr: use I/O stats arguments in FlushUnlockedBuffer()
- 31b0544b32bc 19 (unreleased) landed