Re: Strange locking choices in pg_shdepend.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Strange locking choices in pg_shdepend.c
Дата
Msg-id 21626.1200956790@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Strange locking choices in pg_shdepend.c  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Strange locking choices in pg_shdepend.c  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> Why does shdepDropOwned() take AccessExclusiveLock on pg_shdepend?

> Hmm, I can't recall nor deduce any reason for that.  Perhaps the
> intention was to protect against itself; but I think this should only
> matter if we're dropping the same role concurrently (otherwise the
> to-be-dropped objects would be disjoint sets, so it doesn't matter),
> which should be already protected by the lock on the role itself.

> Hmm, unless revoking privileges concurrently, for two different users on
> the same object could cause a problem?  I don't see us grabbing a lock
> on the object itself -- does this matter?

Well, if there is any such problem then it could be triggered by two
independent plain-ol-REVOKE commands, so I still don't see an argument
why shdepDropOwned is more at risk than anything else.  I think we
should just downgrade the lock.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] setof record "out" syntax and returning records
Следующее
От: Larry Rosenman
Дата:
Сообщение: Makefile support for Mac OS X Fat Binaries?