age(xid) on hot standby - Mailing list pgsql-hackers

From Peter Eisentraut
Subject age(xid) on hot standby
Date
Msg-id 1325095449.24752.4.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: age(xid) on hot standby
List pgsql-hackers
The check_postgres txn_wraparound action[0] runs this query:
  SELECT datname, age(datfrozenxid) AS age FROM pg_database WHERE datallowconn ORDER BY 1, 2

On a hot standby, this fails with:
  ERROR:  cannot assign TransactionIds during recovery

So, a couple of things to wonder about:

Is it unreasonable to check for transaction ID wraparound on a standby?
It should mirror the situation on the primary, shouldn't it?

Should the age(xid) function do something more useful on a standby,
e.g., have a custom error message or return null or use the transaction
ID from the master?

The error message is coded as an elog() call, meaning that users
shouldn't see it, but it can evidently be triggered by a user, so maybe
we should decorate it with some detail, depending on the outcome of the
previous question.

(It looks like age(xid) isn't documented at all.  Maybe it should be.)


[0] - http://bucardo.org/check_postgres/check_postgres.pl.html#txn_wraparound



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 16-bit page checksums for 9.2
Next
From: Steve Crawford
Date:
Subject: Re: pgstat wait timeout