Re: Refactor UnpinBuffer() - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Refactor UnpinBuffer()
Date
Msg-id CALj2ACUQWqfohD40zAUEX+EB0mjKTy_3MDct2ee+d-2DMV1y6g@mail.gmail.com
Whole thread Raw
In response to Re: Refactor UnpinBuffer()  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Refactor UnpinBuffer()
List pgsql-hackers
On Thu, Sep 29, 2022 at 1:52 PM Aleksander Alekseev
<aleksander@timescale.com> wrote:
>
> > Is it safe to move the call to ResourceOwnerForgetBuffer() to before the
> > call to GetPrivateRefCountEntry()? From my quick skim of the code, it
> > seems like it should be safe, but I thought I'd ask the question.
> >
> > Same question, have a look, it doesn’t seem to matter.
>
> Yep, I had some doubts here as well but it seems to be safe.

The commit 2d115e47c861878669ba0814b3d97a4e4c347e8b that removed the
last UnpinBuffer() call with fixOwner as false in ReleaseBuffer().
This commit is pretty old and +1 for removing the unused function
parameter.

Also, it looks like changing the order of GetPrivateRefCountEntry()
and ResourceOwnerForgetBuffer() doesn't have any effect as they are
independent, but do we want to actually do that if there's no specific
reason?

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Avoid memory leaks during base backups
Next
From: Alvaro Herrera
Date:
Subject: do away with ALTER TABLE "Recurse" subcmd types