Re: NT + deadlock intended behaviour ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: NT + deadlock intended behaviour ?
Дата
Msg-id 27764.1090129137@sss.pgh.pa.us
обсуждение исходный текст
Ответ на NT + deadlock intended behaviour ?  (Gaetano Mendola <mendola@bigfoot.com>)
Ответы Re: NT + deadlock intended behaviour ?
Список pgsql-hackers
Gaetano Mendola <mendola@bigfoot.com> writes:
> why SESSION 1 was unblocked ?
> ...
> Why that commit unblock the SESSION 1?

IMHO session 1 should have been unblocked in both cases as soon as
session 2's subtransaction failed.  We have always made a practice
of releasing a transaction's locks immediately upon failure.

The reason it does not seem to act that way is that Alvaro's taken a
shortcut in WaitForTransaction: subtransactions do not take out a
separate transaction lock and so WaitForTransaction has to wait for the
top-level transaction.  Your sub-COMMIT fails the outer transaction
(because the inner one is failed) and so the top transaction lock
releases at that point.  In the sub-ABORT case the outer transaction
stays good and continues to hold its lock.

I've already suggested that this shortcut is no good, and now I'm
pretty sure of it ...
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: NT + deadlock intended behaviour ?
Следующее
От: Mark Kirkwood
Дата:
Сообщение: PITR COPY Failure (was Point in Time Recovery)