Re: [PATCHES] WAL logging freezing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] WAL logging freezing
Date
Msg-id 21576.1162504231@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] WAL logging freezing  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] WAL logging freezing  ("Simon Riggs" <simon@2ndquadrant.com>)
Re: [PATCHES] WAL logging freezing  ("Zeugswetter Andreas ADI SD" <ZeugswetterA@spardat.at>)
Proposal: vacuum and autovacuum parameters to control freezing  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> * pg_clog is truncated according to the oldest pg_database.datvacuumxid.

While testing this patch I realized that there's a bit of an issue here.
It's usually going to be the case that the oldest datvacuumxid is
template0's, meaning that it will never be possible to truncate clog
until autovacuum decides that template0 is at risk of wraparound and
goes and vacuums it.  Shortening the freeze horizon will reduce the size
that pg_clog occupies just *after* that happens, but we're still going
to see pg_clog bloating up to something close to 256MB before autovacuum
kicks in.  And there is nothing a user can do about it, unless he's
willing to override the datallowconn = false safety cover on template0
so he can connect to it and vacuum it manually.

This wasn't a problem in the pre-8.2 logic because we ignored
non-connectable databases while determining the global minimum
datvacuumxid, but it's a real problem now.

Seems like either we go back to ignoring non-connectable databases
(with the risks that entails), or adopt some more-aggressive policy
for launching autovacuums on them, or give up the idea of keeping
pg_clog small.  A more-aggressive policy seems like the best option,
but I'm not entirely sure what it should look like.  Maybe force
autovacuum when age(datvacuumxid) exceeds twice the freeze horizon,
or some such?  Comments?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: Design Considerations for New Authentication Methods
Next
From: Andrew Sullivan
Date:
Subject: Re: Design Considerations for New Authentication Methods