Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Date: 2021-06-08 18:45:14
Message-ID: 20210608184514.GG16435@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 08, 2021 at 02:01:51PM -0400, Alvaro Herrera wrote:
> On 2021-Jun-08, Justin Pryzby wrote:
>
> > On Tue, Jun 08, 2021 at 12:06:02PM -0400, Alvaro Herrera wrote:
> > > On 2021-Jun-06, Justin Pryzby wrote:
> > >
> > > > However, I also found an autovacuum chewing 100% CPU, and it appears the
> > > > problem is actually because autovacuum has locked a page of pg-statistic, and
> > > > every other process then gets stuck waiting in the planner. I checked a few
> > > > and found these:
> > >
> > > Hmm ... I wonder if this could be related to commits d9d076222f5b,
> > > c98763bf51bf, etc. I don't have any connecting thoughts other than the
> > > tuple visibility code being involved. Do you see any procs with the
> > > PROC_IN_SAFE_IC flag set?
> >
> > Can you give me a hint how to do that from a corefile ?
>
> (gdb) set $i=0
> (gdb) set $total = ProcGlobal->allProcCount
> (gdb) while($i<$total)
> >print ProcGlobal->allProcs[$i++]->statusFlags
> >end

They're all zero except for:

$201 = 1 '\001'
$202 = 3 '\003'
$203 = 1 '\001'

src/include/storage/proc.h-#define PROC_IS_AUTOVACUUM 0x01 /* is it an autovac worker? */
src/include/storage/proc.h-#define PROC_IN_VACUUM 0x02 /* currently running lazy vacuum */
src/include/storage/proc.h:#define PROC_IN_SAFE_IC 0x04 /* currently running CREATE INDEX

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-06-08 19:04:28 Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic
Previous Message Peter Geoghegan 2021-06-08 18:40:31 Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic