Re: typo: XIDs are actually compared using modulo-2^32 arithmetic

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: typo: XIDs are actually compared using modulo-2^32 arithmetic
Date: 2013-12-14 20:19:11
Message-ID: CAM-w4HPRWUYd=MS-bUC-vGgUCVZtMVkvNoPQCVY7i9FQYLtDLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I don't have a source tree handy but iirc we treaty 2^31 values as being in
the past and 2^31 values as being in the future.

I've been trying to think how to protect better against the recent vacuum
freeze bug. If someone ruins vacuum freeze now and has any wrapped values
they'll destroy their possibly recoverable data.

It seems to me we shouldn't really need 2^31 values in the future. If
vacuum or hot pruning comes across an xid far in the future, say a million
xids further into the future than the most recent transaction, then it
should signal an error rather than just treat it as being in the future.

--
greg
On 12 Dec 2013 09:41, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Gianni Ciolli <gianni(dot)ciolli(at)2ndquadrant(dot)it> writes:
> > It seems there is a typo here:
> >
> http://www.postgresql.org/docs/devel/static/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
> > where we say that we compare XIDs using arithmetic modulo 2^31, which
> > should instead be 2^32 (as it is with uint32, e.g. xid_age).
>
> [ thinks about that for awhile... ] Yeah, I think you're right.
> Patch pushed, thanks!
>
> regards, tom lane
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-12-14 20:35:46 Re: Extension Templates S03E11
Previous Message Jeff Davis 2013-12-14 20:11:56 Re: Extension Templates S03E11