Re: the s_lock_stuck on perform_spin_delay

From: Andy Fan <zhihuifan1213(at)163(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <tmunro(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: the s_lock_stuck on perform_spin_delay
Date: 2024-01-15 05:19:56
Message-ID: 8734uz17va.fsf@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Robert Haas <robertmhaas(at)gmail(dot)com> writes:

> On Wed, Jan 10, 2024 at 10:17 PM Andy Fan <zhihuifan1213(at)163(dot)com> wrote:
>> fixed in v2.
>
> Timing the spinlock wait seems like a separate patch from the new sanity checks.

Yes, a separate patch would be better, so removed it from v4.

> I suspect that the new sanity checks should only be armed in
> assert-enabled builds.

There are 2 changes in v4. a). Make sure every code is only armed in
assert-enabled builds. Previously there was some counter++ in non
assert-enabled build. b). Record the location of spin lock so that
whenever the Assert failure, we know which spin lock it is. In our
internal testing, that helps a lot.

--
Best Regards
Andy Fan

Attachment Content-Type Size
v4-0001-Detect-more-misuse-of-spin-lock-automatically.patch text/x-diff 9.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2024-01-15 05:43:32 Re: BRIN indexes vs. SK_SEARCHARRAY (and preprocessing scan keys)
Previous Message jian he 2024-01-15 05:00:00 Re: Compile warnings in dbcommands.c building with meson