Re: Confusing deadlock report

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Confusing deadlock report
Дата
Msg-id 27469.1458135905@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Confusing deadlock report  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: Confusing deadlock report  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> 2016-03-12 13:51:29.305 CET [23912]: [2-1] user=arthur,db=prod,app=[unknown] DETAIL: Process 23912 waits for
ShareLockon transaction; blocked by process 24342.  
>         Process 24342 waits for ShareLock on transaction 39632974; blocked by process 23912.
>         Process 23912: UPDATE alpha SET some_flag = $1 WHERE (id = $2)
>         Process 24342: INSERT INTO bravo (..., alpha_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)

> Can the foreign key between bravo and alpha play a role here?

Absolutely.  The insert will need a sharelock on whatever alpha row the
new bravo row references.  Perhaps the newly-inserted row references some
row that 23912 previously updated (in the same transaction) while the
alpha row 23912 is currently trying to update was previously share-locked
by 24342 as a side effect of some previous insert?

            regards, tom lane


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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: Confusing deadlock report
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_dump crashing