Re: Fix unsafe coding in ResourceOwnerReleaseAll() - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: Fix unsafe coding in ResourceOwnerReleaseAll()
Date
Msg-id CAH2L28tZ4sR-N41NXzgG3dbmygDTcOyCZDtjEmnMiU_zE0khtw@mail.gmail.com
Whole thread
Responses Re: FOR PORTION OF code review
List pgsql-hackers
Hi,

> Hi,
>
> > +1 for having a function that just releases all resources in a resource
> > owner in one call. I don't think it's performance critical so it could
> > just call ResourceOwnerRelease() three times.
> > ReleaseAuxProcessResources() could make use of it too.
> >
>
> Thank you for the feedback. I am working on a patch for this and will
> post it soon.
>

While I agree that calling ResourceOwnerRelease() three times results
in a patch with minimal changes to existing logic, I think it is worth avoiding
the unneces calls to simplify the code.

Hence, I added another phase to the ResourceReleasePhase which
bypasses the phased release in the existing
ResourceOwnerRelease function. This allows us to maintain the existing function
signature for both phased and non-phased resource release.
This is similar to what NoLock does in the case of LOCKMODE.

A separate thread for this discussion with a patch has been started
here [1] as it
has branched off from the original proposal in this thread.

[1] https://www.postgresql.org/message-id/CAH2L28vVo-Q3Jf%2BP4huRKxjnbF%2B2t7OdDh3ZGMxL88hiWezd%3DA%40mail.gmail.com

Thank you,
Rahila Syed



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Crashes on a partition whose concurrent detach never finished
Next
From: Xuneng Zhou
Date:
Subject: Re: timeout value overflow in wait for lsn