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

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)
Дата
Msg-id 20230613.163921.1246444645573084901.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Avoid unncessary always true test (src/backend/storage/buffer/bufmgr.c)  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
At Tue, 13 Jun 2023 15:11:26 +0900, Michael Paquier <michael@paquier.xyz> wrote in 
> 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?

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.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: add non-option reordering to in-tree getopt_long
Следующее
От: David Steele
Дата:
Сообщение: Re: Views no longer in rangeTabls?