Re: pgsql: dshash: Add sequential scan support.

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgsql: dshash: Add sequential scan support.
Date: 2022-07-05 03:21:40
Message-ID: CA+hUKGK=YDaxXanxSpMOKZxzAEUq9RGtcfY7sZTZO-WpLBFJEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Jul 5, 2022 at 11:25 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2022-07-05 11:20:54 +1200, Thomas Munro wrote:
> > Since there were 6 places with I-hold-no-lock assertions, I shoved the
> > loop into a function so I could do:
> >
> > - Assert(!status->hash_table->find_locked);
> > + assert_no_lock_held_by_me(hash_table);
>
> I am a *bit* wary about the costs of that, even in assert builds - each of the
> partition checks in the loop will in turn need to iterate through
> held_lwlocks. But I guess we can also just later weaken them if it turns out
> to be a problem.

Maybe we should add assertion support for arrays of locks, so we don't
need two levels of loop? Something like the attached?

Attachment Content-Type Size
v3-0001-Fix-lock-assertions-in-dshash.c.patch text/x-patch 9.4 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-07-05 03:54:56 pgsql: Remove durable_rename_excl()
Previous Message Michael Paquier 2022-07-05 01:16:58 pgsql: Replace durable_rename_excl() by durable_rename(), take two

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2022-07-05 03:30:30 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Ibrar Ahmed 2022-07-05 03:17:26 CFM Manager