From: Andres Freund <andres@anarazel.de>
To: David Pacheco <dap@joyent.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] postmaster deadlock while logging after syslogger exited
Date: Mon, 20 Nov 2017 10:34:58 -0800
Message-ID: <20171120183458.kdc5qklykeu74k2e@alap3.anarazel.de> (raw)
In-Reply-To: <CACukRjPp+JicsFFKD-P6ORQhjs_sEw_OFOXXkefWbk0ToNywAg@mail.gmail.com>
References: <CACukRjOaR2_DY2tLzPe-ZJUActf8RcZ=r1HimQxFgYBy++aR8Q@mail.gmail.com>
<19239.1510000503@sss.pgh.pa.us>
<20171117015040.m36ovf5dqtg3star@alap3.anarazel.de>
<22373.1510886389@sss.pgh.pa.us>
<20171117025438.vjvgmrrnkpnojleq@alap3.anarazel.de>
<23680.1510887983@sss.pgh.pa.us>
<5B347B42-1A82-448A-9814-CAAB3BA189E8@anarazel.de>
<24571.1510889371@sss.pgh.pa.us>
<CACukRjPp+JicsFFKD-P6ORQhjs_sEw_OFOXXkefWbk0ToNywAg@mail.gmail.com>
Hi,
On 2017-11-20 10:13:57 -0800, David Pacheco wrote:
> I expect what happened is that the syslogger process attempted to allocate
> memory, failed because the system was low, and explicitly exited. That's
> consistent with an exited process, no core file generated, and the "FATAL"
> "out
> of memory" entries in the log I posted.
Well unfortunately we're presumably not going to see output from
syslogger's death itself, chicken and egg etc.
> Tom Lane wrote:
> > Hm, so that's another angle David didn't report on: is it possible that
> > his workload could have resulted in a very large volume of incomplete
> > in-progress log messages?
>
> Yes. I mentioned in my Nov 6 mail that large log messages over a
> short period appear to have been a major contributing factor:
So it's actually quite possible that syslogger did use a fair amount of
memory. Could you show its memory usage, just via ps?
> This is a critical point. As far as I can tell, all that's necessary
> for this deadlock to occur is:
>
> - the syslogger is unable to make forward progress (e.g., because it
> segfaulted)
This specific case I don't care that much about, but ...
> - enough other processes write to the pipe that it fills up before the
> postmaster can restart the syslogger
> - the postmaster attempts to write to the log as part of any of its signal
> handling operations
>
> It seems to me that the same thing can happen if there were a bug in the
> syslogger that resulted in a segfault around the same time that the
> postmaster
> attempted to start an autovacuum worker, for example (if there was also
> reasonably high log traffic).
Greetings,
Andres Freund
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-general@postgresql.org
Cc: andres@anarazel.de, dap@joyent.com, tgl@sss.pgh.pa.us
Subject: Re: [GENERAL] postmaster deadlock while logging after syslogger exited
In-Reply-To: <20171120183458.kdc5qklykeu74k2e@alap3.anarazel.de>
References: <CACukRjOaR2_DY2tLzPe-ZJUActf8RcZ=r1HimQxFgYBy++aR8Q@mail.gmail.com> <19239.1510000503@sss.pgh.pa.us> <20171117015040.m36ovf5dqtg3star@alap3.anarazel.de> <22373.1510886389@sss.pgh.pa.us> <20171117025438.vjvgmrrnkpnojleq@alap3.anarazel.de> <23680.1510887983@sss.pgh.pa.us> <5B347B42-1A82-448A-9814-CAAB3BA189E8@anarazel.de> <24571.1510889371@sss.pgh.pa.us> <CACukRjPp+JicsFFKD-P6ORQhjs_sEw_OFOXXkefWbk0ToNywAg@mail.gmail.com> <20171120183458.kdc5qklykeu74k2e@alap3.anarazel.de>
* 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