Log Rotation Documentation Update

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема Log Rotation Documentation Update
Дата
Msg-id 157184641143.26620.17338358043488452407@wrigleys.postgresql.org
обсуждение исходный текст
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/runtime-config-logging.html
Description:

Hi all:

We recently ran into an unusual case where the following occurred:
- PG log directory is a separate filesystem from PG data and other
operations-critical data.
- PG logs directory filled to 100% usage due to outside circumstances (PG
continued functioning, despite logging issues)
- Once disk usage issue was resolved (disk space was again available), the
log file would not rotate on time/size based triggers and would continue to
grow in size.
- Log rotation would only resume after issuing a SIGHUP


I believe that this case would be ideally documented
(https://www.postgresql.org/docs/current/runtime-config-logging.html), as
it's a valid state based on the code:

https://github.com/postgres/postgres/blob/c96581abe418a3bf64b643aa4e27091d1eaea1c1/src/backend/postmaster/syslogger.c

Specifically highlighting the sections:
```
   /* 
   * If we had a rotation-disabling failure, re-enable rotation 
   * attempts after SIGHUP, and force one immediately. 
   */ 
  if (rotation_disabled) 
  { 
   rotation_disabled = false; 
   rotation_requested = true; 
  }
```

I will note that it is logged in PG Log output as noted below:
```
/*
* ENFILE/EMFILE are not too surprising on a busy system; just
* keep using the old file till we manage to get a new one.
* Otherwise, assume something's wrong with Log_directory and stop
* trying to create files.
*/
if (errno != ENFILE && errno != EMFILE)
{
ereport(LOG,
(errmsg("disabling automatic rotation (use SIGHUP to re-enable)")));
rotation_disabled = true;
}
```
However, it is also notable that because these logs are not rotated as
expected, one may not see the above error message unless they sort through a
log file on an unexpected date/time.
Further, I'm not sure how that message would ever even get logged if
rotation is halted due to disk filling up.

I believe this could be rectified by noting the situations where log
rotation would be disabled (such as the disk full state described) and the
action to resume log rotation (issue a SIGHUP to re-enable) in the
https://www.postgresql.org/docs/current/runtime-config-logging.html page.

Cheers,

В списке pgsql-docs по дате отправления:

Предыдущее
От: Tuomas Leikola
Дата:
Сообщение: Re: uniqueness and null could benefit from a hint for dba
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Typo on Refresh Materialized View page