public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Lakhin <[email protected]>
To: Robert Haas <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Assert in heapgettup_pagemode() fails due to underlying buffer change
Date: Thu, 6 Jun 2024 22:00:01 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+TgmoYbxzL4Zexu6cAZSrjYNRKVn+7t6Pccn+TaVry3sefT+w@mail.gmail.com>
References: <[email protected]>
	<CA+TgmoYbxzL4Zexu6cAZSrjYNRKVn+7t6Pccn+TaVry3sefT+w@mail.gmail.com>

Hello Robert,

06.06.2024 19:36, Robert Haas wrote:
> On Thu, Jun 6, 2024 at 6:00 AM Alexander Lakhin <[email protected]> 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.

Yes, my last experiment with memcmp for the whole buffer was wrong,
given the comment above heapgettup_pagemode(). I think the correct
check would be:
              ItemId      lpp;
              OffsetNumber lineoff;
+ItemIdData      iid;

              lineoff = scan->rs_vistuples[lineindex];
              lpp = PageGetItemId(page, lineoff);
+iid = *((ItemIdData *)lpp);
+for (int i = 0; i < 1000; i++)
+Assert(memcmp(&iid, lpp, sizeof(iid)) == 0);

It significantly alleviates reproducing of the test failure for me.
Will try to bisect this anomaly tomorrow.

Best regards,
Alexander






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Assert in heapgettup_pagemode() fails due to underlying buffer change
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox