From: Tomas Vondra <tv@fuzzy.cz>
To: Jon Nelson <jnelson+pgsql@jamponi.net>
Cc: pgsql-bugs@postgresql.org
Subject: Re: crazy logging from PG 8.4
Date: Wed, 23 Oct 2013 16:44:01 +0200
Message-ID: <4b1a3cc650d1ab10de13360bf2222dc2.squirrel@sq.gransy.com> (raw)
In-Reply-To: <CAKuK5J3pOn9TnZ0LvZV7G+8bT8PTzAXti4+TLpWzuAd0s+2CNA@mail.gmail.com>
References: <CAKuK5J3pOn9TnZ0LvZV7G+8bT8PTzAXti4+TLpWzuAd0s+2CNA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 23 Říjen 2013, 16:00, Jon Nelson wrote:
> After several days of running a simple query over a very large dataset
> (more than a terabyte), I logged in to note that postgresql had
> decided to log *billions* of log lines.
>
> The query looks like this:
>
> create table result_table as
> select TEXTFIELD, count(distinct INTFIELD) from SOME_HUGE_TABLE group
> by TEXTFIELD;
>
> At some point, PG started logging stuff that looked like this (over
> and over again):
>
> SELECT 2704204951 user@dbname LOG: 00000: performsort starting: CPU
> 0.00....
>
> The 2704204951 number corresponds to the "%l" (session line number)
> in log_line_prefix. Thus, by the time I saw this, it had logged 2.7
> billion lines.
>
>
> An strace of the process showed this, over and over again:
>
> getrusage(....)
> write(2, <logging info>)
>
> and nothing else. What happened here? It seems like PG just went
> crazy and got itself into some sort of loop. I had to kill the query.
First guess is that you enabled detailed logging in config. See
log_*_stats in
http://www.postgresql.org/docs/8.4/static/runtime-config-statistics.html
I'd guess it's log_executor_stats, but as you've copied a single line (and
not even that one was complete), it's hard to say.
Those are the only lines referring to getrusage in the source code,
although I'm not sure any of those could that produce the number of
messages you've mentioned.
> This is PostgreSQL 8.4.13 on x86_64, Linux, using Scientific Linux 6.4.
Not really the most updated 8.4 install. Please consider updating to 8.4.18.
Tomas
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tv@fuzzy.cz, jnelson+pgsql@jamponi.net
Subject: Re: crazy logging from PG 8.4
In-Reply-To: <4b1a3cc650d1ab10de13360bf2222dc2.squirrel@sq.gransy.com>
References: <CAKuK5J3pOn9TnZ0LvZV7G+8bT8PTzAXti4+TLpWzuAd0s+2CNA@mail.gmail.com> <4b1a3cc650d1ab10de13360bf2222dc2.squirrel@sq.gransy.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox