Re: heap_tuple_needs_freeze false positive

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: heap_tuple_needs_freeze false positive
Date: 2012-02-02 17:54:50
Message-ID: CA+TgmoZ+4r0CKPqgi7uWQsFesVsX-hS+EgCh4S94GZPBHxkKUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 2, 2012 at 12:45 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I believe the adequate defense that we have is precisely the logic you
> are proposing to change.  Regardless of whether you want to call
> XMAX_INVALID a hint or, say, a giant tortoise, I am fairly sure that
> we don't WAL-log setting it.  That means that a bit set before a crash
> won't necessarily still be set after a crash.  But the corresponding
> relfrozenxid advancement will be WAL-logged, leading to the problem
> scenario I described.

To put that another way, the problem isn't that we might have code
somewhere in the system that ignores HEAP_XMAX_INVALID. The problem
is that HEAP_XMAX_INVALID might not still be set on that tuple the
next time somebody looks at it, if a database crash intervenes after
that bit is set and before it is flushed to disk.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-02-02 18:01:48 ecpglib use PQconnectdbParams
Previous Message Gilles Darold 2012-02-02 17:47:35 Re: Patch pg_is_in_backup()