Re: Is this a problem in GenericXLogFinish()? - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Is this a problem in GenericXLogFinish()?
Date
Msg-id CAA4eK1Li7jVwmjexcUz+doa=JSUdz9NmpJbZXT=o2qpyyy48yQ@mail.gmail.com
Whole thread Raw
In response to Re: Is this a problem in GenericXLogFinish()?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Is this a problem in GenericXLogFinish()?
List pgsql-hackers
On Mon, Oct 30, 2023 at 7:13 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> On Sat, Oct 28, 2023 at 6:15 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > > Hmm.  So my question is: do we need the cleanup lock on the write
> > > buffer even if there are no tuples, and even if primary bucket and the
> > > write bucket are the same?
> >
> > Yes, we need it to exclude any concurrent in-progress scans that could
> > return incorrect tuples during bucket squeeze operation.
>
> Amit, thanks for weighing in, but I'm not convinced. I thought we only
> ever used a cleanup lock on the main bucket page to guard against
> concurrent scans.
>

My understanding is the same. It is possible that my wording is not
clear. Let me try to clarify again, Michael asked: "do we need the
cleanup lock on the write buffer even if there are no tuples, and even
if primary bucket and the write bucket are the same?" My reading of
his question was do we need a cleanup lock even if the primary bucket
and write bucket are the same which means the write bucket will be the
first page in the chain and we need a cleanup lock on it. I think the
second condition (no tuples) seems irrelevant here as whether that is
true or false we need a cleanup lock.

>
 Here you seem to be saying that we need a cleanup
> lock on some page that may be an overflow page somewhere in the middle
> of the chain, and that doesn't seem right to me.
>

Sorry, I don't intend to say this.


--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Add new option 'all' to pg_stat_reset_shared()
Next
From: "下雨天"
Date:
Subject: fix 'ERROR: could not identify a comparison function for type iso-8859-1'