Обсуждение: SIGABRT causes messages at LOG but not PANIC

Поиск
Список
Период
Сортировка

SIGABRT causes messages at LOG but not PANIC

От
Justin Pryzby
Дата:
postgres=# SELECT log_time , database, user_name, error_severity sev, left(message,99) FROM
postgres_log_2021_11_10_0800WHERE log_time BETWEEN '2021-11-10 08:57' AND '2021-11-10 08:58' AND database IS NULL;
 
          log_time          | database | user_name | sev |                                                left
                                      
 

----------------------------+----------+-----------+-----+-----------------------------------------------------------------------------------------------------
 2021-11-10 08:57:17.041-04 |          |           | LOG | checkpoint starting: time
 2021-11-10 08:57:55.494-04 |          |           | LOG | server process (PID 31345) was terminated by signal 6:
Aborted
 2021-11-10 08:57:55.494-04 |          |           | LOG | terminating any other active server processes
 2021-11-10 08:57:55.524-04 |          |           | LOG | all server processes terminated; reinitializing
 2021-11-10 08:57:55.719-04 |          |           | LOG | database system was interrupted; last known up at 2021-11-10
08:56:38AST
 
 2021-11-10 08:57:56.16-04  |          |           | LOG | database system was not properly shut down; automatic
recoveryin progress
 
 2021-11-10 08:57:56.24-04  |          |           | LOG | redo starts at 1B4E/F019B9F8
 2021-11-10 08:57:56.271-04 |          |           | LOG | invalid record length at 1B4E/F0245B58: wanted 24, got 0
 2021-11-10 08:57:56.272-04 |          |           | LOG | redo done at 1B4E/F0245B10 system usage: CPU: user: 0.00 s,
system:0.00 s, elapsed: 0.03 s
 
 2021-11-10 08:57:56.412-04 |          |           | LOG | checkpoint starting: end-of-recovery immediate
 2021-11-10 08:57:56.773-04 |          |           | LOG | checkpoint complete: wrote 116 buffers (0.2%); 0 WAL file(s)
added,0 removed, 0 recycled; write=0.
 
 2021-11-10 08:57:56.856-04 |          |           | LOG | database system is ready to accept connections

I'm surprised that not a single message was logged at PANIC, even though it's
defined to mean:

| PANIC     Reports an error that caused all database sessions to abort.
https://www.postgresql.org/docs/current/runtime-config-logging.html#RUNTIME-CONFIG-SEVERITY-LEVELS

Is it intended ?

-- 
Justin



Re: SIGABRT causes messages at LOG but not PANIC

От
Tom Lane
Дата:
Justin Pryzby <pryzby@telsasoft.com> writes:
> I'm surprised that not a single message was logged at PANIC, even though it's
> defined to mean:

The backend you killed didn't get a chance to log anything.

Or to put it another way: a PANIC ereport is the trigger for a database
restart, not a response to some other event that has triggered one.

            regards, tom lane