Re: GetBufferDescriptor() being called for local buffers from MarkBufferDirtyHint()

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-07-03T03:08:03Z
Lists: pgsql-hackers
On Fri, Jul 03, 2026 at 06:22:12AM +0530, Ayush Tiwari wrote:
> v3 does what you suggested: both GetBufferDescriptor() and
> GetLocalBufferDescriptor() now take a signed int, but only
> GetBufferDescriptor()
> keeps the bounds assertion (id >= 0 && id < NBuffers). I need to
> spend some more time on the GetLocalBufferDescriptor function.

Ah sorry, I have unfortunately missed your point upthread.  At least
we are on the same line.  :)

I have just applied your v3, let's close this thread.
--
Michael

Commits

  1. Switch Get[Local]BufferDescriptor() to use a signed value in input

  2. Fix MarkBufferDirtyHint() to not call GetBufferDescriptor() for local buffers

  3. Require share-exclusive lock to set hint bits and to flush