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-02T04:46:54Z
Lists: pgsql-hackers
On Wed, Jul 01, 2026 at 08:00:38PM +0530, Ayush Tiwari wrote: > v2 attached sets NLocBuffer = nbufs before the initialization loop, so the > loop can keep using GetLocalBufferDescriptor(), and drops the now-redundant > assignment at the end. Catching up with the latest activity of this thread now that v20 has opened up. That's kind of nice. I have been also reminded about BufferIsValid(), where we already have similar assertions. As a whole, that seems acceptable to me, and using unsigned still does not make much sense here. Any thoughts or objections regarding a HEAD-only change? -- Michael
Commits
-
Switch Get[Local]BufferDescriptor() to use a signed value in input
- ba4134075a82 master landed
-
Fix MarkBufferDirtyHint() to not call GetBufferDescriptor() for local buffers
- e18b0cb7344c 19 (unreleased) landed
-
Require share-exclusive lock to set hint bits and to flush
- 82467f627bd4 19 (unreleased) cited