Re: AccessExclusiveLock on tuple?

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: AccessExclusiveLock on tuple?
Дата
Msg-id 20151202122503.4a0b3f401d5d3d2178cb258a@potentialtech.com
обсуждение исходный текст
Ответ на AccessExclusiveLock on tuple?  (Christophe Pettus <xof@thebuild.com>)
Ответы Re: AccessExclusiveLock on tuple?  (Christophe Pettus <xof@thebuild.com>)
Список pgsql-general
On Wed, 2 Dec 2015 09:01:37 -0800
Christophe Pettus <xof@thebuild.com> wrote:

> On 9.4, I've encountered a locking message I've not seen before:
>
>     process 5293 still waiting for AccessExclusiveLock on tuple (88636,15) of relation 18238 of database 16415 after
5000.045ms 
>
> What conditions produce an "AccessExclusiveLock on tuple"?  Attempting to lock a tuple when another process has done
anexplicit LOCK ACCESS EXCLUSIVE? 

No. See the section on row level locks here:
http://www.postgresql.org/docs/9.4/static/explicit-locking.html

Essentially, any data modification could take an exclusive lock on the row(s)
that it's going to modify. Generally, this will be an UPDATE statement,
although the same thing happens when you do SELECT ... FOR UPDATE.

The message you're seeing simply means that one process has been waiting for
a long time for the lock to release (5 seconds in this case). Deadlocks are
automatically handled, so this is not a deadlock. Although if the process
holding the lock does not commit the transaction, the waiting process will
wait indefinitely.

If this is happening infrequently, it's probably of no concern. If it's
happening frequently, you'll want to investigate what process is holding
the locks for so long and see what can be done about it.

--
Bill Moran


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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: XID wraparound with huge pg_largeobject
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: AccessExclusiveLock on tuple?