Re: FOR SHARE vs FOR UPDATE locks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: FOR SHARE vs FOR UPDATE locks
Дата
Msg-id 5315.1165334613@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: FOR SHARE vs FOR UPDATE locks  (Jim Nasby <decibel@decibel.org>)
Ответы Re: FOR SHARE vs FOR UPDATE locks  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Jim Nasby <decibel@decibel.org> writes:
> As for possibly using the in-memory store of multiple CIDs affecting  
> a tuple, could that not work if that store contained enough  
> information to 'rollback' the lock to it's original state when  
> restoring to a savepoint? AFAIK other backends would only need to  
> know what the current lock being held was, they wouldn't need to know  
> the history of it themselves...

One of the interesting problems is that if you upgrade shared lock to
exclusive and then want to roll that back, you might need to un-block
other processes that tried to acquire share lock after you acquired
exclusive.  We have no way to do that in the current implementation.
(Any such processes will be blocked on your transaction ID lock, which
you can't release without possibly unblocking the wrong processes.)
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: old synchronized scan patch
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Double entries in log for page slots in beta3