heap_lock_updated_tuple_rec can leak a buffer refcount

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема heap_lock_updated_tuple_rec can leak a buffer refcount
Дата
Msg-id CAA4eK1KJKwhc=isgTQHjM76CAdVswzNeAuZkh_cx-6QgGkSEgA@mail.gmail.com
обсуждение исходный текст
Ответы Re: heap_lock_updated_tuple_rec can leak a buffer refcount
Список pgsql-hackers
It seems to me that heap_lock_updated_tuple_rec can lead to a buffer
refcount leak while locking an updated tuple by an aborted
transaction.  In commit - 5c609a74, we have added the code to deal
with aborted transactions as below:

heap_lock_updated_tuple_rec()
{
..

if (PageIsAllVisible(BufferGetPage(buf)))
visibilitymap_pin(rel, block, &vmbuffer);
else
vmbuffer = InvalidBuffer;

LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
..
-------------------------- below code is added by commit -5c609a74 -----------
if (TransactionIdDidAbort(HeapTupleHeaderGetXmin(mytup.t_data)))
{
UnlockReleaseBuffer(buf);
return HeapTupleMayBeUpdated;
}
-------------------------------------------------------------

I think the above code forgets to deal with vmbuffer and can lead to a
leak of the same.  Attached patch ensures that it deals with vmbuffer
when required.


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: rename sgml files?
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: In logical replication concurrent update of partition key createsa duplicate record on standby.