Re: heap_update() VM retry could break HOT?

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: heap_update() VM retry could break HOT?
Дата
Msg-id CABOikdMV2No_+uuaHGsaeLO=MPJKOUXqPvoEP3PBG0BtkdBkLw@mail.gmail.com
обсуждение исходный текст
Ответ на heap_update() VM retry could break HOT?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers


On Mon, Jul 18, 2016 at 12:47 PM, Andres Freund <andres@anarazel.de> wrote:

as far as I can see that could mean that we perform hot updates when not
permitted, because the tuple has been replaced since, including the
pkey. Similarly, the wrong tuple lock mode could end up being used.

Am I missing something?


If the to-be-updated tuple gets updated while we were retrying vm pinning, heap_update() should return HeapTupleUpdated and the caller must wait for the updating transaction to finish, retry update with the new version (or fail depending on the isolation level). Given that HeapTupleSatisfiesUpdate() is called after l2, the logic seems fine to me.

Thanks,
Pavan

--
 Pavan Deolasee                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Improving executor performance
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Reviewing freeze map code