Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)
Date
Msg-id CAEudQAqyBzH-nnhwkPsMzP8TGMR164XDO5fdk+b5-XKp2KuxrQ@mail.gmail.com
Whole thread Raw
In response to Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)
List pgsql-hackers
Em qua., 14 de jun. de 2023 às 13:32, Gurjeet Singh <gurjeet@singh.im> escreveu:
On Wed, Jun 14, 2023 at 5:12 AM Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Em qua., 14 de jun. de 2023 às 06:51, Richard Guo <guofenglinux@gmail.com> escreveu:
>>
>>
>> On Tue, Jun 13, 2023 at 3:39 PM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:
>>>
>>> Gurjeet has mentioned that eb.rel cannot be modified by another
>>> process since the value or memory is in the local stack, and I believe
>>> he's correct.
>>>
>>> If the pointed Relation had been blown out, eb.rel would be left
>>> dangling, not nullified. However, I don't believe this situation
>>> happens (or it shouldn't happen) as the entire relation should already
>>> be locked.
>>
>>
>> Yeah, Gurjeet is right.  I had a thinko here.  eb.rel should not be NULL
>> pointer in any case.  And as we've acquired the lock for it, it should
>> not have been closed.  So I think we can remove the check for eb.rel in
>> the two places.
>
> Ok,
> As there is a consensus on removing the tests and the comment is still relevant,
> here is a new version for analysis.

LGTM.
Created an entry in commitfest to track this.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Support to define custom wait events for extensions
Next
From: Amit Langote
Date:
Subject: Re: obsolete filename reference in parser README