Re: postmaster 8.2 eternally hangs in sempaphore lock acquiring

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: postmaster 8.2 eternally hangs in sempaphore lock acquiring
Date: 2007-03-29 15:36:41
Message-ID: 460BDD09.2010701@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Martin Pitt wrote:
> Since our Launchpad developers switched from 8.1 to 8.2.3, they often
> encounter a situation when the postmaster gets stuck and needs to be
> restarted. This happens on various CREATE commands (FUNCTION,
> DATABASE, not consistently).
>
> The backtraces show that the process doing the CREATION, another
> client connection that InitPostgres(), and the autovacuum daemon all
> hang eternally in PGSemaphoreLock(), so I suspect that there is a race
> condition of some sort?

So it seems.. :(

> I tried to reproduce this with an hour-long run of CREATE/DROP
> DATABASE, but without success.
>
> It occurred to me that the process which does the CREATE is in
> _bt_vacuum_cycleid(), is that also related to the autovacuum daemon?
> I asked the original reporter (Mark Shuttleworth, in CC) to disable
> the autovacuum daemon for testing.

_bt_vacuum_cycleid is always called on page splits, but it is related to
vacuums. All vacuums, not to autovacuum in particular. If you're going
to run more tests, I'd suggest running VACUUM in a loop in the
background, to see if that makes the bug occur.

> https://launchpad.net/bugs/93042 has symbolic gdb backtraces of all
> three processes that are involved.
>
> At this point I am not sure which further information I could provide.
> Mark would be happy provide more information and/or directly talk with
> you.

Thanks.

I can't see how a BtreeVacuumLock-related deadlock could occur, we never
acquire any other lock while holding it. I'll try to reproduce this on
my laptop..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2007-03-29 17:32:06 Re: postmaster 8.2 eternally hangs in sempaphore lock acquiring
Previous Message Martin Pitt 2007-03-29 14:08:10 postmaster 8.2 eternally hangs in sempaphore lock acquiring