Re: xid wraparound

From: Mark Rostron <mrostron(at)ql2(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: xid wraparound
Date: 2010-09-26 21:33:23
Message-ID: FD020D3E50E7FA479567872E5F5F31E3045A05CBA1@ex01.corp.ql2.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

>
>> When the XID wraps, at the moment it does so, unless you set
>> vacuum_freeze_min_age to 0 and a vacuum has just been performed, is
>> there not a chance that there will be some data loss?
>
>No. XID comparisons are modulo 2^31.
>

Thanks - I'm still trying to wrap my mind around this (sorry).

So, for the sake of this description:
- the XID space (size 2^32) is split into two sub-spaces, each of size 2^31
- each XID is quantified in terms of "space" (0,1) plus "offset" (modulo 2^31) : x(s,o)
- each db row is stamped with an "age" XID : r(s,o)
- each db query start is an XID : q(s,o)

Therefore, a query can only see rows where:
(q.o > r.o) && (q.s == r.s) || (q.o <= r.o) && (q.s != r.s)

Something like that?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-09-27 00:42:59 Re: xid wraparound
Previous Message Stan Hoeppner 2010-09-26 09:58:29 Re: [NOVICE] - SAN/NAS/DAS - Need advises