Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Date
Msg-id CA+Tgmobp6dTu++ihM45SCjAL=E=f_6MfUgxS_cryauc8vGMwcg@mail.gmail.com
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
List pgsql-hackers
On Fri, May 11, 2012 at 1:28 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'm not convinced this is the best thing, and I'm definitely not happy
> with changing the behavior of working cases (ie, behavior on the master)
> in the back branches.
>
> Anybody else have an opinion on this?

I agree with you.  Essentially, if we want age() to be stable, and
nobody's argued against that, we have to fix a point in the XID space
and do all of our computations relative to that point.  The original
coding did that be using our XID, and I think what we ought to do is
use either (1) our XID or (2) the next XID as of the first point in
time at which age() is called, if we don't have an XID yet then.
That's a slight behavior change even when not in HS mode, because a
read-only transaction won't acquire an XID just by virtue of using
age(), so I would probably have chosen to fix this only in master and
to not back-patch anything, but in practice I think the downside of
that behavior change is very minimal (and it might even be an equally
minimal improvement for some people) so I think a back-patch is fine.
However, I don't really see any particular merit in removing our own
XID from the picture entirely: that changes the behavior more
significantly for no particular benefit.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Ensure age() returns a stable value rather than the latest value
Next
From: Greg Stark
Date:
Subject: Re: Gsoc2012 idea, tablesample