Re: Exclusive lock for database rename

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Exclusive lock for database rename
Дата
Msg-id 20051104220213.GB9989@pervasive.com
обсуждение исходный текст
Ответ на Re: Exclusive lock for database rename  (Andrew - Supernews <andrew+nonews@supernews.com>)
Ответы Re: Exclusive lock for database rename  (Jochem van Dieten <jochemd@gmail.com>)
Список pgsql-hackers
On Thu, Nov 03, 2005 at 07:40:15PM -0000, Andrew - Supernews wrote:
> On 2005-11-03, Peter Eisentraut <peter_e@gmx.net> wrote:
> > Peter Eisentraut wrote:
> >> Someone wanted to rename a database while someone else was running a
> >> rather long pg_dump, so the rename had to wait, and everyone else had
> >> to wait for the rename because no new connections would be allowed.
> >
> > As an auxiliary issue, why do the new connections have to wait in this
> > case?  The rename waits for the AccessShareLock of the dump to be
> > released, but meanwhile new connections should be able to get
> > AccessShareLocks of their own.
> 
> No. New AccessShare locks block behind the pending AccessExclusive lock.
> Otherwise AccessShare locks could starve the exclusive lock forever.

I would argue that in cases like this (and 'this' means just about any
DDL, for starters) that it would be better not to block everyone until
work can actually be done. Or at least make that an option.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Crash during elog.c...
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: Reducing the overhead of NUMERIC data