Re: MultiXact truncation, startup et al. - Mailing list pgsql-hackers

From Andres Freund
Subject Re: MultiXact truncation, startup et al.
Date
Msg-id 20131129080954.GB5645@awork2.anarazel.de
Whole thread Raw
In response to Re: MultiXact truncation, startup et al.  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: MultiXact truncation, startup et al.
List pgsql-hackers
Hi,

Thanks, looks saner than my version ;)

On 2013-11-29 01:00:35 -0300, Alvaro Herrera wrote:
> !                 /*
> !                  * FIXME this calls TransactionIdDidAbort() internally,
> !                  * falsifying the claim in the comment at the top ...
> !                  */
> !                 update_xid = HeapTupleGetUpdateXid(tuple);

Yea. I think we should remove that behaviour from
HeapTupleGetUpdateXid() - we don't need to rely on it here.

> !                 /*
> !                  * XXX we rely here on HeapTupleGetUpdateXid returning
> !                  * Invalid for aborted updates.
> !                  */
> !                 if (!TransactionIdIsValid(update_xid))
> !                     freeze_xmax = true;

I've just added this case because HeapTupleGetUpdateXid() currently can
return InvalidTransactionId - I'd be perfectly fine to just place the
aborted xid in there.

> !                  * FIXME -- what if it's a committed update which has recent
> !                  * new locker transaction?  The tuple wouldn't have been
> !                  * removed in that case (HeapTupleSatisfiesVacuum returns
> !                  * RECENTLY_DEAD).
> !                  */

Afaics we should be protected against that by virtue of GetOldestMultiXactId().

> ***************
> *** 5645,5668 **** heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_xid,
> !                 /* we don't care about lockers */
> !                 if (members[i].status != MultiXactStatusNoKeyUpdate ||
> !                     members[i].status == MultiXactStatusUpdate)
> !                     continue;

Dangerous typo alert. Should also be replaced by
ISUPDATE_from_mxstatus(). Alternatively, if we decide to make
HeapTupleGetUpdateXid() not make that DidAbort() check, we can simply
get rid of doing the loop ourselves alltogethers.

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Next
From: Antonin Houska
Date:
Subject: Re: Todo item: Support amgettuple() in GIN