Re: "multiple backends attempting to wait for pincount 1"

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: "multiple backends attempting to wait for pincount 1"
Date: 2015-02-13 22:38:37
Message-ID: 20150213223837.GB2620@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-02-13 22:33:35 +0000, Kevin Grittner wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > On 2015-02-13 00:27:04 -0500, Tom Lane wrote:
>
> >> I'd say we have a problem. I'd even go so far as to say that
> >> somebody has completely broken locking, because this looks like
> >> autovacuum and manual vacuuming are hitting the same table at
> >> the same time.
>
> > One avenue to look are my changes around both buffer pinning and
> > interrupt handling...
>
> I found a way to cause this reliably on my machine and did a
> bisect. That pointed to commit 6753333f55e1d9bcb9da4323556b456583624a07
>
> For the record, I would build and start the cluster, start two psql
> sessions, and paste this into the first session:

> drop table if exists m;
> create table m (id int primary key);
> insert into m select generate_series(1, 1000000) x;
> checkpoint;
> vacuum analyze;
> checkpoint;
> delete from m where id between 50 and 100;
> begin;
> declare c cursor for select * from m;
> fetch c;
> fetch c;
> fetch c;
>
> As soon as I saw the fetches execute I hit Enter on this in the
> other psql session:

> vacuum freeze m;
>
> It would block, and then within a minute (i.e., autovacuum_naptime)
> I would get the error.

Great! Thanks for that piece of detective work. I've been travelling
until an hour ago and not looked yet. How did you get to that recipe?

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2015-02-13 23:05:16 Re: "multiple backends attempting to wait for pincount 1"
Previous Message Kevin Grittner 2015-02-13 22:33:35 Re: "multiple backends attempting to wait for pincount 1"