Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Gurjeet Singh <gurjeet(at)singh(dot)im>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)
Date: 2023-06-13 06:11:26
Message-ID: ZIgIjhYW81WCTYc4@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 12, 2023 at 10:51:24PM -0700, Gurjeet Singh wrote:
> To me, it looks like these checks are a result of code being
> copy-pasted from somewhere else, where this check might have been
> necessary. The checks are sure not necessary at these spots.

I am not completely sure based on my read of the code, but isn't this
check needed to avoid some kind of race condition with a concurrent
backend may have worked on the relation when attempting to get the
lock?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2023-06-13 06:11:42 Re: Improving FTS for Greek
Previous Message Nathan Bossart 2023-06-13 06:11:14 Re: Improve logging when using Huge Pages