Subject: Re: Assert in heapgettup_pagemode() fails due to underlying buffer change

From: Robert Haas <[email-masked]>
Date: Thu, 6 Jun 2024 12:36:32 -0400

On Thu, Jun 6, 2024 at 6:00 AM Alexander Lakhin <[email-masked]> wrote:
> Am I missing something or the the page buffer indeed lacks locking there?

I don't know, but if the locks are really missing now, I feel like the
first question is "which commit got rid of them?". It's a little hard
to believe that they've never been there and somehow nobody has
noticed.

Then again, maybe we have; see Noah's thread about in-place updates
breaking stuff and some of the surprising discoveries there. But it
seems worth investigating.

-- 
Robert Haas
EDB: http://www.enterprisedb.com

---

From: Noah Misch <[email-masked]>
Date: Thu, 6 Jun 2024 12:07:02 -0700

> seems worth investigating.

$SUBJECT looks more like a duplicate of
postgr.es/m/flat/[email-masked] (Hot standby queries see
transient all-zeros pages).

---

From: Alexander Lakhin <[email-masked]>
Date: Fri, 7 Jun 2024 06:00:00 +0300

Hello Noah,

> transient all-zeros pages).

Thank you for the reference! Yes, it looks very similar. Though I can't
say the sleep you proposed helps the failure reproduction (I've tried
026_overwrite_contrecord.pl and saw no more frequent failures or so).

My bisect run ended with:
210622c60e1a9db2e2730140b8106ab57d259d15 is the first bad commit

Author: Thomas Munro <[email-masked]>
Date:   Wed Apr 3 00:03:08 2024 +1300

     Provide vectored variant of ReadBuffer().

Other buildfarm failures with this Assert I could find kind of confirm this:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=calliphoridae&dt=2024-04-03%2003%3A32%3A18
(presumably a first failure of this sort)
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=tamandua&dt=2024-04-04%2015%3A38%3A16
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=margay&dt=2024-05-07%2004%3A00%3A08

Best regards,
Alexander