Re: Locking a row with KEY SHARE NOWAIT blocks

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Locking a row with KEY SHARE NOWAIT blocks
Дата
Msg-id
23380.1567517496@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Locking a row with KEY SHARE NOWAIT blocks Heikki Linnakangas <hlinnaka@iki.fi>
Re: Locking a row with KEY SHARE NOWAIT blocks Tom Lane <tgl@sss.pgh.pa.us>
Re: Locking a row with KEY SHARE NOWAIT blocks Heikki Linnakangas <hlinnaka@iki.fi>
Re: Locking a row with KEY SHARE NOWAIT blocks Amit Kapila <amit.kapila16@gmail.com>
Heikki Linnakangas  writes:
> When you lock a row with FOR KEY SHARE, and the row's non-key columns 
> have been updated, heap_lock_tuple() walks the update chain to mark all 
> the in-progress tuple versions also as locked. But it doesn't pay 
> attention to the NOWAIT or SKIP LOCKED flags when doing so. The 
> heap_lock_updated_tuple() function walks the update chain, but the 
> 'wait_policy' argument is not passed to it. As a result, a SELECT in KEY 
> SHARE NOWAIT query can block waiting for another updating transaction, 
> despite the NOWAIT modifier.

> This can be reproduced with the attached isolation test script.

> I'm not sure how to fix this. The logic to walk the update chain and 
> propagate the tuple lock is already breathtakingly complicated :-(.

Why are we locking any but the most recent version?

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: fn ln
Дата:
От: Fujii Masao
Дата:
FAQ