Re: pgsql: Fix a couple of bugs in MultiXactId freezing

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgsql: Fix a couple of bugs in MultiXactId freezing
Date: 2013-12-14 12:05:33
Message-ID: 20131214120533.GA25520@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 2013-12-13 17:08:46 -0300, Alvaro Herrera wrote:
> Andres Freund wrote:
> > Afaics this will cause HEAP_KEYS_UPDATED to be reset, is that
> > problematic? I don't really remember what it's needed for TBH...
>
> So we do reset HEAP_KEYS_UPDATED, and in general that bit seems critical
> for several things. So it should be kept when a Xmax is carried over
> from the pre-frozen version of the tuple. But while reading through
> that, I realize that we should also be keeping HEAP_HOT_UPDATED in that
> case. And particularly we should never clear HEAP_ONLY_TUPLE.

That's only for the multi->plain xid case tho, right?

> So I think heap_execute_freeze_tuple() is wrong, because it's resetting
> the whole infomask to zero, and then setting it to only the bits that
> heap_prepare_freeze_tuple decided that it needed set. That seems bogus
> to me. heap_execute_freeze_tuple() should only clear a certain number
> of bits, and then possibly set some of the same bits; but the remaining
> flags should remain untouched.

Uh, my version and the latest you've sent intiially copy the original
infomask to the freeze plan and then manipulate those. That seems fine
to me. Am I missing something?

Greetings,

Andres Freund

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-12-14 22:34:20 pgsql: Fix inherited UPDATE/DELETE with UNION ALL subqueries.
Previous Message Alvaro Herrera 2013-12-13 20:28:06 pgsql: Fix typo

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-12-14 12:20:25 Re: "stuck spinlock"
Previous Message Alexander Korotkov 2013-12-14 09:59:02 PoC: Partial sort