MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ?

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ?
Дата
Msg-id iildev09j32l60llssd3jp549h5lv19gvn@4ax.com
обсуждение исходный текст
Ответы Re: MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
If a transaction marks a tuple for update and later commits without
actually having updated the tuple, do we still need the information
that the tuple has once been reserved for an update or can we simply
set the HEAP_XMAX_INVALID hint bit of the tuple?

In other words, is this snippet from a patch I'm working on a valid
modification to HeapTupleSatisfiesVacuum in tqual.c?
   {       if (TransactionIdIsInProgress(HeapTupleHeaderGetXmax(tuple)))           return HEAPTUPLE_LIVE;
-           if (TransactionIdDidCommit(HeapTupleHeaderGetXmax(tuple)))
-               tuple->t_infomask |= HEAP_XMAX_COMMITTED;
-           else
-/* it's either aborted or crashed */
-               tuple->t_infomask |= HEAP_XMAX_INVALID;
+           /*
+            * We don't really care whether xmax did commit, abort or
+            * crash. We know that xmax did mark the tuple for update,
+            * but it did not and will never actually update it.
+            */
+           tuple->t_infomask |= HEAP_XMAX_INVALID;   }   return HEAPTUPLE_LIVE;

There are a few more places in tqual.c which could be simplified like
that.

ServusManfred


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

Предыдущее
От: "P.M"
Дата:
Сообщение: PostgreSQL under Windows
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: Function returns composite type