Re: PG10.1 autovac killed building extended stats

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG10.1 autovac killed building extended stats
Date: 2017-11-17 16:36:00
Message-ID: 20171117163600.d7zsm2odaizikdhs@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Pryzby wrote:

> Core was generated by `postgres: autovacuum worker process gtt '.
> Program terminated with signal 11, Segmentation fault.
> #0 statext_ndistinct_build (totalrows=300, numrows=300, rows=0x21df3e8, attrs=<value optimized out>, stats=0x0) at mvdistinct.c:103
> 103 item->attrs = bms_add_member(item->attrs,
>
> (gdb) p stats
> $5 = (VacAttrStats **) 0x0
> => This is an error, no ??

Not necessarily, but then I think this previous code is busted:

/*
* Check if we can build these stats based on the column analyzed. If
* not, report this fact (except in autovacuum) and move on.
*/
stats = lookup_var_attr_stats(onerel, stat->columns,
natts, vacattrstats);
if (!stats && !IsAutoVacuumWorkerProcess())
{
ereport(WARNING,
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
errmsg("statistics object \"%s.%s\" could not be computed for relation \"%s.%s\"",
stat->schema, stat->name,
get_namespace_name(onerel->rd_rel->relnamespace),
RelationGetRelationName(onerel)),
errtable(onerel)));
continue;
}

If I recall things correctly, the "continue" should be executed
regardless of IsAutoVacuumWorkerProcess() (only the log should be
conditional on that). I'm not sure how I arrived at the current coding,
which I added in bf2a691e02d7 -- probably just fuzzy thinking.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2017-11-17 16:39:06 Re: PG10.1 autovac crashed building extended stats
Previous Message Alvaro Herrera 2017-11-17 16:27:49 Re: PG10.1 autovac killed building extended stats