Re: bufmgr: pass through I/O stats context in FlushUnlockedBuffer()

From: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
To: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: bufmgr: pass through I/O stats context in FlushUnlockedBuffer()
Date: 2026-04-21 22:24:04
Message-ID: 275CB553-A9F6-4C4D-92FD-78DCC139205F@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Apr 22, 2026, at 05:52, Melanie Plageman <melanieplageman(at)gmail(dot)com> wrote:
>
> On Tue, Mar 31, 2026 at 10:15 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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

Hi Melanie, thank you very much for pushing.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-04-21 23:12:45 Re: [PATCH] Fix null pointer dereference in PG19
Previous Message Melanie Plageman 2026-04-21 21:52:35 Re: bufmgr: pass through I/O stats context in FlushUnlockedBuffer()