Re: Autovacuum loose ends

From: Alvaro Herrera
Subject: Re: Autovacuum loose ends
Date: ,
Msg-id: 20050722225432.GA2734@alvh.no-ip.org
(view: Whole thread, Raw)
In response to: Autovacuum loose ends  (Tom Lane)
Responses: Re: Autovacuum loose ends  (Tom Lane)
List: pgsql-hackers

Tree view

Autovacuum loose ends  (Tom Lane, )
 Re: Autovacuum loose ends  ("Matthew T. O'Connor", )
  Re: Autovacuum loose ends  (Tom Lane, )
   Re: Autovacuum loose ends  ("Matthew T. O'Connor", )
   Re: Autovacuum loose ends  (Greg Stark, )
   Re: Autovacuum loose ends  (Hannu Krosing, )
   Re: Autovacuum loose ends  (Ron Mayer, )
    Re: Autovacuum loose ends  (Tom Lane, )
 Re: Autovacuum loose ends  (Alvaro Herrera <-ip.org>, )
  Re: Autovacuum loose ends  (Tom Lane, )
  Re: Autovacuum loose ends  (Tom Lane, )
 Re: Autovacuum loose ends  (Alvaro Herrera <-ip.org>, )
  Re: Autovacuum loose ends  (Tom Lane, )
   Re: Autovacuum loose ends  (Alvaro Herrera <-ip.org>, )

On Thu, Jul 14, 2005 at 10:52:56AM -0400, Tom Lane wrote:

Hey,

> * Or actually, it would vacuum template0, except that since no regular
> backend ever connects to template0, there will be no stats DB entry for
> it and so the loop in AutoVacMain will ignore it.  This is definitely
> BAD as it means that a database that's not been touched since postmaster
> start will never be vacuumed, not even for XID wraparound prevention.
> That test needs to be weakened.

I've hacked the whole thing enough that I fixed most of the issues.
However this one I don't know how to handle.  What I need to do is
compare each database's frozen Xid with the current transaction Id.
I can get the frozenxid from the flatfile -- however I don't have
anything with which to compare it.  I tried ReadNewTransactionId(), but
it doesn't work because it tries to acquire a LWLock, which isn't
possible because we don't have a PGPROC before connecting to a database.

I guess I could the Xid from pg_control.  This seems unclean however.
Opinions about doing that?  Better ideas?

-- 
Alvaro Herrera (<alvherre[a]alvh.no-ip.org>)
"Crear es tan difícil como ser libre" (Elsa Triolet)



pgsql-hackers by date:

From: "Luke Lonergan"
Date:
Subject: Re: A Guide to Constraint Exclusion (Partitioning)
From: Simon Riggs
Date:
Subject: Re: A Guide to Constraint Exclusion (Partitioning)