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

From Bruce Momjian
Subject Re: Bug in autovacuum.c?
Date
Msg-id 201103312159.p2VLxFP10298@momjian.us
Whole thread Raw
In response to Re: Bug in autovacuum.c?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Bug in autovacuum.c?
Re: Bug in autovacuum.c?
List 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 -> 5104 -> 4103 -> 3102 -> max_xid101 -> max_xid - 1100 -> max_xid - 2 99 -> max_id 98 -> max_id -1

Wouldn't you rather:
105 -> 5104 -> 4103 -> 3102 -> 3101 -> 3100 -> 3 99 -> max_id 98 -> max_id -1

--  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: Robert Haas
Date:
Subject: Re: Bug in autovacuum.c?
Next
From: "Kevin Grittner"
Date:
Subject: Re: cast from integer to money