Re: Vacuum/visibility is busted

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Vacuum/visibility is busted
Date: 2013-02-08 14:57:37
Message-ID: 20130208145736.GA3980@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavan Deolasee escribió:

> I'm trying to reason how this bug explains what we saw. In the test,
> we'd left with duplicate tuples. If I just take index 219 in the table
> as an example, that tuple had three duplicates. The tuple with CTID
> (150, 126) had the index pointer and the rest two were dangling tuples
> in the heap.

Hm, the examples I chased had t_infomask 0x2500, that is there were no
HOT bits set. It's quite possible that there's another bug in here, but
this one is a real one and it explains a very similar problem.

Now, how would your answers change if HeapTupleSatisfiesVacuum returned
RECENTLY_DEAD instead of DEAD? That's what I saw; and when it happened,
vacuum didn't set the "tupgone" flag, and thus passed the tuple to
heap_freeze_tuple; that routine examined the tuple and removed the Xmax
and set the HEAP_XMAX_INVALID bit because of the bogus logic. A tuple
which was supposed to be dead suddenly turned into visible.

I'm not really sure how these bogus conditions make HOT misbehave; I
don't fully understand the page pruning stuff. I think if they see a
chain and in the middle of it one Xmin doesn't match the next tuple's
Xmax, it considers the whole thing to not be a chain at all. So maybe
that explains the other effects?

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Kretschmer 2013-02-08 14:57:47 Re: Bug, Feature, or what else?
Previous Message Adrian Klaver 2013-02-08 14:52:24 Re: Bug, Feature, or what else?