Re: BUG #19006: Assert(BufferIsPinned) in BufferGetBlockNumber() is triggered for forwarded buffer
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Xuneng Zhou <xunengzhou@gmail.com>, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2025-08-10T00:22:10Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix rare bug in read_stream.c's split IO handling.
- 9110d8164169 18.0 landed
- b421223172a2 19 (unreleased) landed
On Sat, Aug 09, 2025 at 04:03:41PM +1200, Thomas Munro wrote: > Here is a new version of the slightly more ambitious fix, for > discussion. I need to figure out if there is any measurable > performance impact, but from an interface sanity and fragility POV it > seems infinitely better like this. I recall being paranoid about > function call width, but it still fits in 6 registers. I think > perhaps the InvalidBuffer-based API might have seemed a shade more > reasonable before I reworked the pin limiting logic, but once I had to > start scanning for forwarded buffers after every StartReadBuffers() > call, I really should have reconsidered that interface. In other > words, maybe a bit of myopic path dependency here... > > XXX does the change have any measurable performance impact? > XXX is the single-buffer specialization unaffected due to dead > code elimination, as expected? > xxx unused queue entries could potentially be electrified with > wipe_mem/VALGRIND_MAKE_MEM_NOACCESS, though existing bufmgr.c assertions > are very likely to reveal any fencepost bugs already > XXX perhaps we don't need quite so many _npinned <= _nblocks assertions With all these comments and b421223172a2 already applied, are you sure that it is a good idea to play with the v18 branch more than necessary? We are in a baked beta2 state, and it looks like all these could qualify as HEAD-only improvements. Perhaps the open item can be closed then? -- Michael