Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)

Поиск
Список
Период
Сортировка
От Marc Munro
Тема Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)
Дата
Msg-id 1170953262.21038.28.camel@bloodnok.com
обсуждение исходный текст
Ответ на Re: referential Integrity and SHARE locks  (Marc Munro <marc@bloodnok.com>)
Ответы Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)  (Csaba Nagy <nagy@ecircle-ag.com>)
Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)  ("Jim C. Nasby" <jim@nasby.net>)
Список pgsql-hackers
I am going to restate my earlier proposal, to clarify it and in the hope
of stimulating more discussion.

One of the causes of deadlocks in Postgres is that its referential
integrity triggers can take locks in inconsistent orders.  Generally a
child record will be locked before its parent, but not in all cases.

My proposal modifies the order in which locks are taken by referential
integrity triggers, so that parents are always locked before their
children.

The proposal is, that referential integrity triggers should fire before
locking the tuple from which they are triggered.  I guess a new sort of
trigger is required for this, a before-lock trigger.

If this is a dumb idea, please tell me why.  If it would cause more
problems than it solves, ditto.  If it would be difficult to implement,
let's discuss and try to find solutions.

__
Marc

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

Предыдущее
От: Marc Munro
Дата:
Сообщение: Re: referential Integrity and SHARE locks
Следующее
От: Csaba Nagy
Дата:
Сообщение: Re: Reducing likelihood of deadlocks (was referential Integrity and SHARE locks)