Hi, On 2025-03-25 09:15:43 -0700, Noah Misch wrote: > On Tue, Mar 25, 2025 at 11:57:58AM -0400, Andres Freund wrote: > > FWIW, I prototyped this, it's not hard. > > > > But it can't replace the current WARNING with 100% fidelity: If we read 60 > > blocks in a single smgrreadv, we today would would emit 60 WARNINGs. But we > > can't encode that many block offset in single PgAioResult, there's not > > enough > > space, and enlarging it far enough doesn't seem to make sense either. > > > > > > What we *could* do is to emit one WARNING for each bufmgr.c > > smgrstartreadv(), > > with that warning saying that there were N zeroed blocks in a read from > > block > > N to block Y and a HINT saying that there are more details in the server > > log.
It should probably be DETAIL, not HINT... > Sounds fine. I got that working. To make it readable, it required changing division of labor between buffer_readv_complete() and buffer_readv_complete_one() a bit, but I think it's actually easier to understand now. Still need to beef up the test infrastructure a bit to make the multi-block cases more easily testable. Could use some input on the framing of the message/detail. Right now it's: ERROR: invalid page in block 8 of relation base/5/16417 DETAIL: Read of 8 blocks, starting at block 7, 1 other pages in the same read are invalid. But that doesn't seem great. Maybe: DETAIL: Read of blocks 7..14, 1 other pages in the same read were also invalid. But that still isn't really a sentence. Greetings, Andres Freund