Re: autovacuum not prioritising for-wraparound tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum not prioritising for-wraparound tables
Date: 2013-01-24 23:48:26
Message-ID: 28562.1359071306@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Browne <cbbrowne(at)gmail(dot)com> writes:
> On Thu, Jan 24, 2013 at 5:22 PM, Heikki Linnakangas
> <hlinnakangas(at)vmware(dot)com> wrote:
>> Backpatching sounds a bit scary. It's not a clear-cut bug, it's just that
>> autovacuum could be smarter about its priorities. There are other ways you
>> can still bump into the xid-wraparound issue, even with this patch.

> I don't think this is a single-priority issue. It's *also* crucial
> that small tables with high "tuple attrition rates" get vacuumed
> extremely frequently; your system will bog down, albeit in a different
> way, if the small tables don't get vacuumed enough.

Yeah. Another problem with a simple-minded priority arrangement is that
it might cause some tables to get starved for service because workers
keep on choosing other ones; we have to be sure the sorting rule is
designed to prevent that.

As posted, what we've got here is sorting on a boolean condition, with
the behavior within each group totally up to the whims of qsort(). That
seems especially dangerous since the priority order is mostly undefined.

I was a bit surprised that Alvaro didn't propose sorting by the age of
relfrozenxid, at least for the subset of tables that are considered
wraparound hazards. Not sure what a good criterion is for the rest.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-01-24 23:55:17 Re: COPY FREEZE has no warning
Previous Message gabrielle 2013-01-24 23:32:09 Clarification of certain SQLSTATE class