Re: [GENERAL] Autovacuum stuck for hours, blocking queries - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Autovacuum stuck for hours, blocking queries
Date
Msg-id 14709.1487284771@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Autovacuum stuck for hours, blocking queries  (Tim Bellis <Tim.Bellis@metaswitch.com>)
Responses Re: [GENERAL] Autovacuum stuck for hours, blocking queries  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: [GENERAL] Autovacuum stuck for hours, blocking queries  (Merlin Moncure <mmoncure@gmail.com>)
Re: [GENERAL] Autovacuum stuck for hours, blocking queries  (Tim Bellis <Tim.Bellis@metaswitch.com>)
List pgsql-general
Tim Bellis <Tim.Bellis@metaswitch.com> writes:
> Even though this is a read only query, is it also expected to be blocked behind the vacuum? Is there a way of getting
indexesfor a table which won't be blocked behind a vacuum? 

It's not the vacuum that's blocking your read-only queries.  It's the
ALTER TABLE, which needs an exclusive lock in order to alter the table's
schema.  The ALTER is queued waiting for the vacuum to finish, and lesser
lock requests queue up behind it.  We could let the non-exclusive lock
requests go ahead of the ALTER, but that would create a severe risk of the
ALTER *never* getting to run.

I'd kill the ALTER and figure on trying again after the vacuum is done.

Also you might want to look into how you got into a situation where
you have an anti-wraparound vacuum that's taking so long to run.
You didn't do something silly like disable autovacuum did you?

            regards, tom lane


pgsql-general by date:

Previous
From: David Hinkle
Date:
Subject: Re: [GENERAL] Bad planning data resulting in OOM killing of postgres
Next
From: Alvaro Herrera
Date:
Subject: Re: [GENERAL] Autovacuum stuck for hours, blocking queries