Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext
Antonin Houska <ah@cybertec.at>
From: Antonin Houska <ah@cybertec.at>
To: alvherre@kurilemu.de
Cc: Euler Taveira <euler@eulerto.com>,
pgsql-hackers@lists.postgresql.org
Date: 2025-09-12T18:03:36Z
Lists: pgsql-hackers
Álvaro Herrera <alvherre@kurilemu.de> wrote: > On 2025-Sep-12, Antonin Houska wrote: > > > Euler Taveira <euler@eulerto.com> wrote: > > > > > Interesting. I'm wondering that if this patch is applied we could remove the > > > following code [...] from pg_logical_slot_get_changes_guts and > > > LogicalSlotAdvanceAndCheckSnapState functions too. IIUC the referred > > > code is a band-aid that will be improved someday. > > > > Even though we're fixing the likely reason of this problem, we cannot be 100% > > sure that no other problem like this still exists. So I'd not remove this > > assignment. Maybe add Assert(CurrentResourceOwner == old_resowner) in front of > > that, and adjust the comment? > > Yeah, I'm going to risk removing it, because if we don't do it now, > we're never going to do it. We can mitigate the risk of missing > remaining bugs by having that assertion you suggest, so that if anyone > actually hits a problem here, we'll know soon enough. > > I have pushed it with that change. I'll also add an open item for pg19 > so that we remember to come back to remove the assertions, if we feel we > no longer need them. I was worried about removing those workarounds because it was not trivial to diagnose the issue. But it should be ok for the master branch. Thanks. -- Antonin Houska Web: https://www.cybertec-postgresql.com
Commits
-
Avoid unexpected changes of CurrentResourceOwner and CurrentMemoryContext
- 7dcea51c2a4d 19 (unreleased) landed