From: | Manfred Koizar <mkoi-pg(at)aon(dot)at> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ? |
Date: | 2003-06-11 07:21:48 |
Message-ID: | iildev09j32l60llssd3jp549h5lv19gvn@4ax.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
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.
Servus
Manfred
From | Date | Subject | |
---|---|---|---|
Next Message | Teodor Sigaev | 2003-06-11 08:23:33 | Re: Function returns composite type |
Previous Message | P.M | 2003-06-11 05:34:04 | PostgreSQL under Windows |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-06-11 12:55:39 | Re: Adding Rendezvous support to postmaster |
Previous Message | Bruce Momjian | 2003-06-11 07:07:15 | Re: Adding Rendezvous support to postmaster |