Re: Is this a problem in GenericXLogFinish()?

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Jeff Davis <pgsql(at)j-davis(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is this a problem in GenericXLogFinish()?
Date: 2023-10-31 03:14:58
Message-ID: CAA4eK1Li7jVwmjexcUz+doa=JSUdz9NmpJbZXT=o2qpyyy48yQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 30, 2023 at 7:13 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Sat, Oct 28, 2023 at 6:15 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 下雨天 2023-10-31 03:15:54 fix 'ERROR: could not identify a comparison function for type unknown'
Previous Message Kyotaro Horiguchi 2023-10-31 02:59:31 Re: Add new option 'all' to pg_stat_reset_shared()