Relocation of tuple between release and re-acquire of tuple lock
От | Alexander Korotkov |
---|---|
Тема | Relocation of tuple between release and re-acquire of tuple lock |
Дата | |
Msg-id | CAPpHfduf_ZPFrb-2VzCcF3nD4R1X9n9YHR4LcDs2wt5kNxRp_A@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Relocation of tuple between release and re-acquire of tuple lock
|
Список | pgsql-hackers |
Hackers,
I'm now exploring code working with heap tuples. The following code in heap_update() catch my eyes.
if (DoesMultiXactIdConflict((MultiXactId) xwait, infomask,
*lockmode))
{
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
/* acquire tuple lock, if necessary */
heap_acquire_tuplock(relation, &(oldtup.t_self), *lockmode,
LockWaitBlock, &have_tuple_lock);
/* wait for multixact */
MultiXactIdWait((MultiXactId) xwait, mxact_status, infomask,
relation, &oldtup.t_self, XLTW_Update,
&remain);
checked_lockers = true;
locker_remains = remain != 0;
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
/*
* If xwait had just locked the tuple then some other xact
* could update this tuple before we get to this point. Check
* for xmax change, and start over if so.
*/
if (xmax_infomask_changed(oldtup.t_data->t_infomask,
infomask) ||
!TransactionIdEquals(HeapTupleGetRawXmax(&oldtup),
xwait))
goto l2;
}
------
В списке pgsql-hackers по дате отправления: