Re: [HACKERS] getting status transaction error

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: postgres general <pgsql-general(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] getting status transaction error
Date: 2007-02-06 20:00:00
Message-ID: 20070206200000.GO22166@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Merlin Moncure wrote:
> On 2/6/07, Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> >> actually, here is some more relevant bits from the log.
> >> Feb 6 06:31:33 mojo postgres[1088]: [1-1] :: LOG: autovacuum:
> >> processing database "template0"
> >> Feb 6 06:31:33 mojo postgres[1088]: [2-1] :: ERROR: could not access
> >> status of transaction 544441911
> >> Feb 6 06:31:33 mojo postgres[1088]: [2-2] :: DETAIL: could not open
> >> file "pg_clog/0207": No such file or directory
> >
> Latest checkpoint's NextXID: 2162841139
> 2^31: 2147483648

I think the relevant arithmetic here is

echo "2162841139 544441911 - p" | dc
1618399228

That's a billion and a half transactions. Autovacuum uses the formula

this_whole_db = (tmp->age >
(int32) ((MaxTransactionId >> 3) * 3 - 100000));

to determine whether it needs database-wide vacuum.
(MaxTransactionId >> 3) is 536870911, so the calculation is
536870911 * 3 - 100000

echo "536870911 3 * 100000 - p" | dc
1610512733

which looks awfully close to the number above. About 7 million
transactions must have passed since the first time the error showed up
-- does that sound likely?

Well, scratch that -- what's the _current_ Xid? (not lastest
checkpoint's)

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-06 20:02:36 Re: [HACKERS] getting status transaction error
Previous Message Merlin Moncure 2007-02-06 19:55:25 Re: [HACKERS] getting status transaction error

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-06 20:02:36 Re: [HACKERS] getting status transaction error
Previous Message Merlin Moncure 2007-02-06 19:55:25 Re: [HACKERS] getting status transaction error