Re: Bug in autovacuum.c? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Bug in autovacuum.c?
Date
Msg-id 201104012311.p31NBND02966@momjian.us
Whole thread Raw
In response to Re: Bug in autovacuum.c?  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian wrote:
> > > I am not so concerned about this case but about other cases where we are
> > > computing xid distances across the invalid range.
> > 
> > Such as?
> 
> Not sure.  I have not had time to research this, but there might be
> cases where this backward movement matters --- remember our XIDs are
> valid only within about a 2 billion range, and we do less/greater
> comparisons in that range (using a macro).  That macro is not going to
> cover over backward xid movement.

OK, I am done training for the day, and found this macro:/* advance a transaction ID variable, handling wraparound
correctly*/#define TransactionIdAdvance(dest)  \    do { \        (dest)++; \        if ((dest) <
FirstNormalTransactionId)\            (dest) = FirstNormalTransactionId; \    } while(0)
 

which seems OK, but we the -= all over varsup.c
   /*    * We'll refuse to continue assigning XIDs in interactive mode once we get    * within 1M transactions of data
loss. This leaves lots of room for the    * DBA to fool around fixing things in a standalone backend, while not    *
beingsignificant compared to total XID space. (Note that since    * vacuuming requires one transaction per table
cleaned,we had better be    * sure there's lots of XIDs left...)    */   xidStopLimit = xidWrapLimit - 1000000;   if
(xidStopLimit< FirstNormalTransactionId)       xidStopLimit -= FirstNormalTransactionId;
 

Now I am not sure where to add a C comment.  :-(

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Bug in autovacuum.c?
Next
From: Darren Duncan
Date:
Subject: Re: Postgres 9.1 - Release Theme