Re: corrupted statistics file "pg_stat_tmp/pgstat.stat"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Carl von Clausewitz" <clausewitz45(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: corrupted statistics file "pg_stat_tmp/pgstat.stat"
Date: 2012-08-15 13:34:24
Message-ID: 2110.1345037664@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Carl von Clausewitz" <clausewitz45(at)gmail(dot)com> writes:
> Ive restored from TAR backup our databases, and everything looked fine. Without changing any setting in postgresql.conf (or in kernel settings) only track_counts=on, after 2-3 days, Im receiving huge number (~5-10 PCS in every second) of error messages like that in /var/log/postgresql.log:
> *** Aug 15 06:27:26 eurodb postgres[77652]: [43-1] WARNING: corrupted statistics file "pg_stat_tmp/pgstat.stat"

Huh. The stats collector process ought to rewrite that file fairly
often, so this suggests it's consistently failing to rewrite it.

You might take a look at what the file looks like after a day or so
of normal operation (eg, how big is it, how often does it get updated)
and then compare to what it looks like after the errors start.

Also, try strace'ing the stats collector process for a little while
(long enough to capture a stats file rewrite sequence) during normal
operation, and then again after the errors start.

I don't want to speculate too much in advance of the data, but I'm
wondering about a ulimit setting that limits how much data the stats
collector can write during its lifetime (ulimit -f or local equivalent).
That would eventually cause problems for any postgres process, but if
you did accidentally have one in place when starting the postmaster,
maybe the stats collector would be first to show symptoms.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2012-08-15 14:17:06 Re: PG Installer - Licensing Issues
Previous Message Alban Hertroys 2012-08-15 13:32:45 Re: corrupted statistics file "pg_stat_tmp/pgstat.stat"