Re: Not deleted mentions of the cleared path - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Not deleted mentions of the cleared path
Date
Msg-id CAMbWs4_Fp5tW0C7+CcMbD0mTtL7ReBDoKDBF6wDdqEMYsMbjDg@mail.gmail.com
Whole thread Raw
In response to Not deleted mentions of the cleared path  (Alena Rybakina <a.rybakina@postgrespro.ru>)
Responses Re: Not deleted mentions of the cleared path
List pgsql-hackers

On Mon, Oct 30, 2023 at 7:31 PM Alena Rybakina <a.rybakina@postgrespro.ru> wrote:
I have already written about the problem of InvalidPath [0] appearing. I investigated this and found an error in the add_path() function, when we reject a path, we free up the memory of the path, but do not delete various mentions of it (for example, in the ancestor of relation, as in the example below).

I agree that what you observed is true - add_path() may free a path
while it's still referenced from some lower rels.  For instance, when
creating ordered paths, we may use the input path unchanged without
copying if it's already well ordered, and it might be freed afterwards
if it fails when competing in add_path().

But this doesn't seem to be a problem in practice.  We will not access
these references from the lower rels.

I'm not sure if this is an issue that we need to fix, or we need to live
with.  But I do think it deserves some explanation in the comment of
add_path().

Thanks
Richard

pgsql-hackers by date:

Previous
From: "下雨天"
Date:
Subject: fix 'ERROR: could not identify a comparison function for type iso-8859-1'
Next
From: Nathan Bossart
Date:
Subject: Re: always use runtime checks for CRC-32C instructions