Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext

From: Antonin Houska <ah(at)cybertec(dot)at>
To: alvherre(at)kurilemu(dot)de
Cc: Euler Taveira <euler(at)eulerto(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext
Date: 2025-09-12 18:03:36
Message-ID: 39892.1757700216@localhost
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:

> On 2025-Sep-12, Antonin Houska wrote:
>
> > Euler Taveira <euler(at)eulerto(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-09-12 18:03:37 Re: Proposal: Out-of-Order NOTIFY via GUC to Improve LISTEN/NOTIFY Throughput
Previous Message Ranier Vilela 2025-09-12 17:53:56 Avoid resource leak (src/test/modules/test_binaryheap/test_binaryheap.c)