Re: Postgres 16.1 - Bug: cache entry already complete

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Amadeo Gallardo <amadeo(at)ruddr(dot)io>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Postgres 16.1 - Bug: cache entry already complete
Date: 2024-01-22 09:49:37
Message-ID: CAApHDvo5aQ742CosTqUMpB9d-Tza09AaBf=kDrBmppfkyQOJvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 4 Jan 2024 at 00:01, Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> As a clause's serial number is unique within the current PlannerInfo
> context, and multiple clones of the same clause have the same serial
> number, it seems to me that it's more correct to calculate the length of
> ppi_clauses by:
>
> bms_num_members(inner_path->param_info->ppi_serials)
>
> So I think maybe we can fix this issue with the attached patch.

Thanks for the patch. I looked at this again and believe the
bms_num_member() check is a good fix.

I considered if Amadeo's case is worth including as a test and I
concluded that having that as a test won't necessarily guard us
against getting this error again if there are still bugs in this area.

David

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tender Wang 2024-01-22 10:36:47 Re: BUG #18297: Error when adding a column to a parent table with complex inheritance
Previous Message Heikki Linnakangas 2024-01-22 09:42:20 Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit