Re: pgsql: Track the current XID wrap limit (or more accurately, the oldest

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Track the current XID wrap limit (or more accurately, the oldest
Date: 2009-08-31 20:17:20
Message-ID: 1558.1251749840@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> 1. Cluster is close to the stop limit.
> 2. Autovacuum runs, updates pg_database and advances oldestXid. Phew!
> 3. Crash.

> After recovery, oldestXid is reset to the old value, and you start
> getting warnings again. However, everything seems fine in pg_database,
> all the databases have been recently vacuumed. Does autovacuum ever run
> to fix that? ISTM it won't.

Autovacuum will certainly run, it's more a question of will it fix
oldestXid. I think we could deal with this by having the just-added
function TransactionIdLimitIsValid() return false if the oldestXid is
far enough back to cause warnings.

(Probably that wasn't the best choice of name, since we now have some
cases where the XID limit data isn't really "invalid" but we want to
force an update anyway. I'm inclined to rename it to something like
ForceTransactionIdLimitUpdate, with inversion of the result sense.)

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-09-01 00:09:42 pgsql: Move processing of startup-packet switches and GUC settings into
Previous Message Tom Lane 2009-08-31 19:41:00 pgsql: Change the autovacuum launcher to read pg_database directly,