Re: Row locking during UPDATE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Row locking during UPDATE
Дата
Msg-id 22649.1062684367@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Row locking during UPDATE  ("David F. Skoll" <dfs@roaringpenguin.com>)
Ответы Re: Row locking during UPDATE
Список pgsql-admin
"David F. Skoll" <dfs@roaringpenguin.com> writes:
> What appears to be happening is this:

> 1) Sometimes, a whole bunch of clients try updating the same row.  I
> see sevaral postgresql processes marked "UPDATE waiting"

Any process that arrives at the row and finds it already modified by
some concurrent transaction will wait for that concurrent transaction
to complete.

> 2) Because the client processes must complete rather quickly, a supervisor
> process kills them if they don't complete soon.

Zapping clients that are in the middle of database operations is bad
design IMHO.

> 3) The postgresql processes in an "UPDATE waiting" state seem to be
> blocked waiting for a semaphore, and they do not notice the closing of
> the connection when the client is killed.

That's correct, a backend will generally not notice client disconnect
until it next waits for a client command.  It's not totally clear why
you've got so many processes waiting to update the same row, though.
Which process does have the row lock, and why isn't it completing its
transaction?

            regards, tom lane

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

Предыдущее
От: Rodrigo De la Peña
Дата:
Сообщение: unsubscrib
Следующее
От: "AlmawElias Fantahun"
Дата:
Сообщение: please remove me from the list