Re: BufferAlloc: don't take two simultaneous locks

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Sokolov Yura <y(dot)sokolov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, michail(dot)nikolaev(at)gmail(dot)com, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Andres Freund <andres(at)anarazel(dot)de>, Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Subject: Re: BufferAlloc: don't take two simultaneous locks
Date: 2022-04-18 13:53:42
Message-ID: CA+TgmobXcqsPhej_opBkCYO7aSh-TheesBVRF2P1k15OCkzkzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 15, 2022 at 4:29 AM Kyotaro Horiguchi
<horikyota(dot)ntt(at)gmail(dot)com> wrote:
> The patch removes buftable entry frist then either inserted again or
> returned to freelist. I don't understand how it can be in both
> buftable and freelist.. What kind of trouble do you have in mind for
> example?

I'm not sure. I'm just thinking about potential dangers. I was more
worried about it ending up in neither place.

> So, does this get progressed if someone (maybe Yura?) runs a
> benchmarking with this method?

I think we're talking about theoretical concerns about safety here,
and you can't resolve that by benchmarking. Tom or others may have a
different view, but IMHO the issue with this patch isn't that there
are no performance benefits, but that the patch needs to be fully
safe. He and I may disagree on how likely it is that it can be made
safe, but it can be a million times faster and if it's not safe it's
still dead.

Something clearly needs to be done to plug the specific problem that I
mentioned earlier, somehow making it so we never need to grow the hash
table at runtime. If anyone can think of other such hazards those also
need to be fixed.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-04-18 13:59:48 Re: Add --{no-,}bypassrls flags to createuser
Previous Message Robert Haas 2022-04-18 13:44:49 Re: Re: fix cost subqueryscan wrong parallel cost