What happens when syslog gets blocked?

Started by Jim Nasbyover 16 years ago6 messagesdocsgeneral
Jump to latest
#1Jim Nasby
Jim.Nasby@BlueTreble.com
docsgeneral

We recently had a problem with a database where the /var filesystem
got corrupted. This appears to have seriously impacted the ability of
STDERR from Postgres to get put out to disk, which ended up blocking
backends.

Because of this we want to switch from using STDERR to using syslog,
but I'm not sure if syslog() can end up blocking or not. I know that
(by default) syslog uses UDP when logging to an external syslog, but
what happens if you're using the local syslog? Is it still UDP or
some other mechanism that could potentially block the backends?

Also, I think we should either warn users about STDERR (and
presumably the CVS logging) or change things so that something that
breaks logging doesn't block backends.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jim Nasby (#1)
docsgeneral
Re: What happens when syslog gets blocked?

decibel <decibel@decibel.org> writes:

We recently had a problem with a database where the /var filesystem
got corrupted. This appears to have seriously impacted the ability of
STDERR from Postgres to get put out to disk, which ended up blocking
backends.

Because of this we want to switch from using STDERR to using syslog,
but I'm not sure if syslog() can end up blocking or not.

syslog (at least in the implementations I'm familiar with) has the
opposite problem: when the going gets tough, it starts losing messages.
I do not think you'll really be making your life better by switching.

regards, tom lane

#3Bill Moran
wmoran@potentialtech.com
In reply to: Tom Lane (#2)
docsgeneral
Re: What happens when syslog gets blocked?

In response to Tom Lane <tgl@sss.pgh.pa.us>:

decibel <decibel@decibel.org> writes:

We recently had a problem with a database where the /var filesystem
got corrupted. This appears to have seriously impacted the ability of
STDERR from Postgres to get put out to disk, which ended up blocking
backends.

Because of this we want to switch from using STDERR to using syslog,
but I'm not sure if syslog() can end up blocking or not.

syslog (at least in the implementations I'm familiar with) has the
opposite problem: when the going gets tough, it starts losing messages.
I do not think you'll really be making your life better by switching.

Well ... "life better" really depends on which failure scenario you're
more comfortable with ... personally, I'd rather lose log messages than
have the DB system go down. Of course, if auditing is critical to your
scenario, then your priorities are different ...

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

#4Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Bill Moran (#3)
docsgeneral
Re: What happens when syslog gets blocked?

On Aug 6, 2009, at 2:00 PM, Bill Moran wrote:

In response to Tom Lane <tgl@sss.pgh.pa.us>:

decibel <decibel@decibel.org> writes:

We recently had a problem with a database where the /var filesystem
got corrupted. This appears to have seriously impacted the
ability of
STDERR from Postgres to get put out to disk, which ended up blocking
backends.

Because of this we want to switch from using STDERR to using syslog,
but I'm not sure if syslog() can end up blocking or not.

syslog (at least in the implementations I'm familiar with) has the
opposite problem: when the going gets tough, it starts losing
messages.
I do not think you'll really be making your life better by switching.

Well ... "life better" really depends on which failure scenario you're
more comfortable with ... personally, I'd rather lose log messages
than
have the DB system go down. Of course, if auditing is critical to
your
scenario, then your priorities are different ...

Bingo. I'm thinking we should make mention of this in the docs...
--
Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

#5Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jim Nasby (#4)
docsgeneral
Re: [GENERAL] What happens when syslog gets blocked?

decibel wrote:

On Aug 6, 2009, at 2:00 PM, Bill Moran wrote:

Well ... "life better" really depends on which failure scenario you're
more comfortable with ... personally, I'd rather lose log messages
than
have the DB system go down. Of course, if auditing is critical to
your
scenario, then your priorities are different ...

Bingo. I'm thinking we should make mention of this in the docs...

I propose the following patch.

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

Attachments:

collector-blocks.patchtext/x-diff; charset=us-asciiDownload+13-0
#6Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alvaro Herrera (#5)
docsgeneral
Re: [GENERAL] What happens when syslog gets blocked?

Alvaro Herrera wrote:

decibel wrote:

On Aug 6, 2009, at 2:00 PM, Bill Moran wrote:

Well ... "life better" really depends on which failure scenario you're
more comfortable with ... personally, I'd rather lose log messages
than
have the DB system go down. Of course, if auditing is critical to
your
scenario, then your priorities are different ...

Bingo. I'm thinking we should make mention of this in the docs...

I propose the following patch.

Committed (on HEAD)

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support