Skip site navigation (1) Skip section navigation (2)

Re: Bug in autovacuum.c?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in autovacuum.c?
Date: 2011-04-01 23:11:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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
     * being significant 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(at)momjian(dot)us>

  + It's impossible for everything to be true. +

In response to

pgsql-hackers by date

Next:From: Darren DuncanDate: 2011-04-02 02:00:41
Subject: Re: Postgres 9.1 - Release Theme
Previous:From: Bruce MomjianDate: 2011-04-01 23:04:02
Subject: Re: Bug in autovacuum.c?

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group