Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache - Mailing list pgsql-bugs

From Kirill Reshke
Subject Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache
Date
Msg-id CALdSSPjsYgY18vCveFzPNJQ_HM6+9i_2CEbt_Lgj5JBx9a==zg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache
List pgsql-bugs
On Wed, 20 Aug 2025 at 18:25, Dilip Kumar <dilipbalaut@gmail.com> wrote:
>
> On Wed, Aug 20, 2025 at 5:13 PM Kirill Reshke <reshkekirill@gmail.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

--
Best regards,
Kirill Reshke



pgsql-bugs by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache
Next
From: Dilip Kumar
Date:
Subject: Re: BUG #19026: ResourceOwnerForget can't find owner for invalid plancache