pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Frost <jeff@pgexperts.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: 9.1.3 backends getting stuck in 'startup'
Date: Fri, 25 May 2012 10:51:20 -0400
Message-ID: <21111.1337957480@sss.pgh.pa.us> (raw)
In-Reply-To: <3B46C63B-A770-45C5-8889-2796C5E3AB84@pgexperts.com>
References: <4F9AC452.3050102@pgexperts.com>
	<28484.1337887297@sss.pgh.pa.us>
	<4FBE9CDB.3030009@pgexperts.com>
	<2196.1337897586@sss.pgh.pa.us>
	<7A939C5B-ABA4-4CF4-9473-F48989399813@pgexperts.com>
	<2784.1337898946@sss.pgh.pa.us>
	<3B46C63B-A770-45C5-8889-2796C5E3AB84@pgexperts.com>

Jeff Frost <jeff@pgexperts.com> writes:
> On May 24, 2012, at 3:35 PM, Tom Lane wrote:
>> Jeff Frost <jeff@pgexperts.com> writes:
>>> BTW, when I connected to it this time, I had a really long time before my psql was able to send a query, so it seems to be still broken at least.

>> Yeah, I was afraid that re-initdb would be at best a temporary solution.

> Oh, sorry, I wasn't clear on that.  The currently running system is still happy, but the old data directory got stuck in 'startup' for a while when I connected via psql.

Hm.  That means there is some contributing factor we haven't identified,
but what?

>> It would probably be useful to confirm the theory that relcache rebuild
>> is what makes it stall.  You should be able to manually remove the
>> pg_internal.init file in the database's directory; then connect with
>> psql, and time how long it takes before the pg_internal.init file
>> reappears.

> So, you're thinking autovac invalidates the cache and causes it to be rebuilt, then a bunch of new connections get stalled as they all wait for the rebuild?

Well, it's worse than that: all the incoming sessions each try to
rebuild the cache file themselves.  So I suspect there's some
"thundering herd" effect on your production system, in addition to
the fact that it's just plain not cheap.  However, if you're seeing
significant stall with just a single incoming connection (the old
system isn't getting actively used, right?) then there is possibly
yet another effect that we need to identify.

As the next step, I'd suggest verifying that the stall is reproducible
if you remove pg_internal.init (and that it's not there otherwise), and
then strace'ing the single incoming connection to see what it's doing.

			regards, tom lane



view thread (27+ messages)

Message-ID: <21111.1337957480@sss.pgh.pa.us>
Permalink:  ../21111.1337957480@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21111.1337957480@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, jeff@pgexperts.com
  Subject: Re: 9.1.3 backends getting stuck in 'startup'
  In-Reply-To: <21111.1337957480@sss.pgh.pa.us>
  References: <4F9AC452.3050102@pgexperts.com> <28484.1337887297@sss.pgh.pa.us> <4FBE9CDB.3030009@pgexperts.com> <2196.1337897586@sss.pgh.pa.us> <7A939C5B-ABA4-4CF4-9473-F48989399813@pgexperts.com> <2784.1337898946@sss.pgh.pa.us> <3B46C63B-A770-45C5-8889-2796C5E3AB84@pgexperts.com> <21111.1337957480@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