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

From Nathan Bossart
Subject Re: Refactor UnpinBuffer()
Date
Msg-id 20220928210828.GA3303@nathanxps13
Whole thread Raw
In response to Refactor UnpinBuffer()  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Refactor UnpinBuffer()
List pgsql-hackers
On Wed, Sep 28, 2022 at 08:14:23PM +0300, Aleksander Alekseev wrote:
> +       ResourceOwnerForgetBuffer(CurrentResourceOwner, b);
> +
>         /* not moving as we're likely deleting it soon anyway */
>         ref = GetPrivateRefCountEntry(b, false);
>         Assert(ref != NULL);
> -
> -       if (fixOwner)
> -               ResourceOwnerForgetBuffer(CurrentResourceOwner, b);

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.
Otherwise, LGTM.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: problems with making relfilenodes 56-bits
Next
From: Thomas Munro
Date:
Subject: Re: making relfilenodes 56 bits