Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache
Date: 2025-08-20 14:56:01
Message-ID: CAFiTN-uauvLrXXJ6uVO0nawT-w6DjSz=wRSRXk43ML50sCSVMg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Aug 20, 2025 at 7:05 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Wed, 20 Aug 2025 at 18:25, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Wed, Aug 20, 2025 at 5:13 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> > > How about attached?
> >
> > Thanks, right it's better to clean up in sql_exec_error_callback. But
> > we should still release the cached plan before setting it to NULL in
> > order to leak the cache plan as I was doing in my patch.
>
> I am under the impression that we don’t. Resource owner will release
> all cached plans in the rollback tx handler.
> This can be confirmed via gdb session: print fcache->cplan in
> sql_exec_error_callback and after this plan in ReleaseCachedPlan in
> this repro.
> These two pointers will be equal
>

That's a valid point. Thanks. I think we can add the same test case
to what is given in this example, maybe in plpgsql.sql or maybe some
other file which is more relevant. So we can continue with the v1
patch only you have sent, maybe you can add a one liner comment to it.

--
Regards,
Dilip Kumar
Google

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-08-20 15:41:38 Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache
Previous Message Kirill Reshke 2025-08-20 13:34:58 Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache