Re: Postgres 16.1 - Bug: cache entry already complete - Mailing list pgsql-bugs

From David Rowley
Subject Re: Postgres 16.1 - Bug: cache entry already complete
Date
Msg-id CAApHDvo5aQ742CosTqUMpB9d-Tza09AaBf=kDrBmppfkyQOJvQ@mail.gmail.com
Whole thread Raw
In response to Re: Postgres 16.1 - Bug: cache entry already complete  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-bugs
On Thu, 4 Jan 2024 at 00:01, Richard Guo <guofenglinux@gmail.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



pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit
Next
From: Tender Wang
Date:
Subject: Re: BUG #18297: Error when adding a column to a parent table with complex inheritance