pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: pgsql-bugs@postgresql.org
Subject: Hung Vacuum in 8.3
Date: Tue, 22 Feb 2011 16:43:37 +1300
Message-ID: <4D6330E9.6030809@catalyst.net.nz> (raw)

This is 8.3.14 on Debian Lenny x86-64.

I'm seeing a hung vacuum:

postgres=# select procpid, query_start,waiting, current_query from 
pg_stat_activity where current_query like '%VACUUM%';
procpid |          query_start          | waiting 
|                                        
current_query                                        
--------+-------------------------------+---------+---------------------------------------------------------------------------------------------
7347    | 2011-02-22 06:02:02.400247+13 | f       | VACUUM ANALYZE;

at approx 1300 (so it has been sitting there for approx 7 hours, normal 
database vacuum time is 10 minutes). Now according to pg_stat_activity 
and pg_locks it is *not* waiting for a lock, but no vacuuming appears to 
be going on. strace says:

$ strace -p 7347

Process 7347 attached - interrupt to quit
semop(33456157, 0x7ffff512bad0, 1

Ok, so we are waiting on a semaphore - hmm, why is it not showing up as 
waiting on a lock of some kind?

Of interest is this:

postgres=# select procpid, query_start, current_query from 
pg_stat_activity order by query_start limit 1;
  procpid |          query_start          
|                                                   current_query
---------+-------------------------------+-------------------------------------------------------------------------------------
    25953 | 2011-02-22 04:24:07.417138+13 | SELECT n.node_id, n.node_ -- 
long query, joining several large tables - text snipped

So this guy had been running from before the vacuum started, so probably 
vacuum is wanting to do lazy_truncate_heap() on one of the tables in the 
join (no gdb on this box unfortunately). I am however still puzzled 
about why no locks are being waited on.

I have canceled the vacuum, but any suggestions for getting more diag 
info for next time?

regards

Mark




view thread (11+ messages)  latest in thread

Message-ID: <4D6330E9.6030809@catalyst.net.nz>
Permalink:  ../4D6330E9.6030809@catalyst.net.nz/
Also on:    postgresql.org/message-id/4D6330E9.6030809@catalyst.net.nz

 · 

reply

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-bugs@postgresql.org
  Cc: mark.kirkwood@catalyst.net.nz
  Subject: Re: Hung Vacuum in 8.3
  In-Reply-To: <4D6330E9.6030809@catalyst.net.nz>
  References: <4D6330E9.6030809@catalyst.net.nz>

* 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