csvlog Behavior when log file missing

From: Lesley Kimmel <lesley(dot)j(dot)kimmel(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: csvlog Behavior when log file missing
Date: 2019-06-04 02:00:27
Message-ID: CAAQu=7TyW-dPN0yKX1VqZsJK=5WX=izs7oPX=2YqaL+JjQeFjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all;

I have a system where postgres seems to be randomly dying. When researching
the issue I, of course, began looking at logs.

I found that much of the logs were missing due to logrotate configuration
on the server. Logs were being rotated by size and then compressed. Because
of this, the first rotation would take the log file out from underneath the
database and it is not recreated.

My suspicion is that the database eventually crashes due to inability to
log. The documentation says the logging_collector will halt other processes
if it is unable to log. However, it seems that the system continues to run
fine for several days before crashing and applications using the database
continue to operate.

Does the logrotate configuration possibly explain the behavior? I can add
the 'copytruncate' option to the logrotate configuration and see if the
issue resolves, but I'd like to also understand the issue. Also, if I add
the 'stderr' destination and continue to rotate the csv log file out, might
I catch errors related to the missing csv log or would the
logging_collector simply continue operating since it still has access to
the stderr log?

Thanks!
LKimmel, RHCE, VCP7-CMA

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2019-06-04 02:05:10 Re: Questions about btree_gin vs btree_gist for low cardinality columns
Previous Message Frank Alberto Rodriguez 2019-06-03 23:39:54 Re: One way replication in PostgreSQL