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

Re: Bug in autovacuum.c?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug in autovacuum.c?
Date: 2011-03-31 21:59:15
Message-ID: 201103312159.p2VLxFP10298@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas wrote:
> > ? ?xidForceLimit = recentXid - autovacuum_freeze_max_age;
> > ? ?if (xidForceLimit < FirstNormalTransactionId)
> > ? ? ? ?xidForceLimit -= FirstNormalTransactionId;
> >
> > The values:
> >
> > ? ? ? ?xidForceLimit ? Result
> > ? ? ? ?---------------------------
> > ? ? ? ?max_xid-2 ? ? ? max_xid-2
> > ? ? ? ?max_xid-1 ? ? ? max_xid-1
> > ? ? ? ?max_xid ? ? ? ? max_xid
> > ? ? ? ?0 ? ? ? ? ? ? ? max_xid-3 ? ? ? <- backward here
> > ? ? ? ?1 ? ? ? ? ? ? ? max_xid-2
> > ? ? ? ?2 ? ? ? ? ? ? ? max_xid-1
> > ? ? ? ?3 ? ? ? ? ? ? ? 3
> 
> You have to consider those three lines all of a piece.  Suppose
> autovacuum_freeze_age is 100.  Then:
> 
> 105 -> 5
> 104 -> 4
> 103 -> 3
> 102 -> max_xid
> 101 -> max_xid - 1
> 100 -> max_xid - 2

OK, just keep going below 100:

	105 -> 5
	104 -> 4
	103 -> 3
	102 -> max_xid
	101 -> max_xid - 1
	100 -> max_xid - 2
	 99 -> max_id
	 98 -> max_id -1

Wouldn't you rather:

	105 -> 5
	104 -> 4
	103 -> 3
	102 -> 3
	101 -> 3
	100 -> 3
	 99 -> max_id
	 98 -> max_id -1

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

In response to

Responses

pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2011-03-31 22:09:23
Subject: Re: cast from integer to money
Previous:From: Robert HaasDate: 2011-03-31 21:33:38
Subject: Re: Bug in autovacuum.c?

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