From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Erik Jones <mage2k@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Hot Standby Conflict on pg_attribute
Date: Fri, 10 May 2019 15:40:55 -0400
Message-ID: <14290.1557517255@sss.pgh.pa.us> (raw)
In-Reply-To: <20190510191437.3gjehobmxdaap7qg@alap3.anarazel.de>
References: <CABX4GUtKd+X=ErJkBjL-xTj+LDPqRa=ErEmYnn6rW+Qtu11VPQ@mail.gmail.com>
<20190510191437.3gjehobmxdaap7qg@alap3.anarazel.de>
Andres Freund <andres@anarazel.de> writes:
> On 2019-05-09 13:03:50 -0700, Erik Jones wrote:
>> The question then is: Why would these user queries be waiting on an
>> AccessShare lock on pg_attribute?
> Queries that access a table for the *first* time after DDL happened
> (including truncating the relation), need an AccessShareLock on
> pg_attribute (and pg_class, pg_index, ...) for a short time.
Also, it seems likely that what's really triggering the issue is
autovacuum on pg_attribute trying to truncate off empty pages
in pg_attribute (after a bunch of dead rows were generated there
by DDL activity). That requires exclusive lock on pg_attribute,
which would propagate down to the standby.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, mage2k@gmail.com
Subject: Re: Hot Standby Conflict on pg_attribute
In-Reply-To: <14290.1557517255@sss.pgh.pa.us>
References: <CABX4GUtKd+X=ErJkBjL-xTj+LDPqRa=ErEmYnn6rW+Qtu11VPQ@mail.gmail.com> <20190510191437.3gjehobmxdaap7qg@alap3.anarazel.de> <14290.1557517255@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox