> On 16 Aug 2026, at 15:00, Andrey Borodin <[email protected]> wrote:
> 
> wal_consistency_checking

Sorry, the message I just sent was intended for the nearby
"GiST wal_consistency_checking issue" thread.  Since I have already bumped
this thread, let me reply to Peter's report too.

Looking back at Kirill's thread that led to 9c9ddf109 [0], I wrote:

> Sorry, I meant so->curBlkno and so->numKilled are semantically correlated.
> But it's difficult to assign them together and this does not worth
> refactoring.

That did not age well.  This bug is exactly the failure mode that observation
anticipated, so I no longer think that these fields should remain
independent.

Calling gistkillitems() from gistrescan() and gistendscan() looks like the
right fix.  Longer term, I think the block number, page LSN and
killed offsets should form one kill-state object, initialized only for a
leaf page and invalidated as a unit.  Visiting an internal page should never
replace the identity of the page to which pending kill offsets belong.

It also seems worth making the leaf-page check effective in non-assert
builds.


Best regards, Andrey Borodin.


[0] 
https://www.postgresql.org/message-id/flat/CALdSSPgZWX_D8%2BFx4YQqRN5eW5iSx_rJdqQhCfdWTvqKXVfJ4w%40mail.gmail.com
[1] 
https://www.postgresql.org/message-id/flat/lxzj26ga6ippdeunz6kuncectr5gfuugmm2ry22qu6hcx6oid6%40lzx3sjsqhmt6

Reply via email to