Re: PATCH: backtraces for error messages

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: PATCH: backtraces for error messages
Дата
Msg-id 20180620152049.zmagmwucyxfqwxwy@alvherre.pgsql
обсуждение исходный текст
Ответ на PATCH: backtraces for error messages  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: PATCH: backtraces for error messages  (Andres Freund <andres@anarazel.de>)
RE: PATCH: backtraces for error messages  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Список pgsql-hackers
On 2018-Jun-20, Craig Ringer wrote:

> Hi folks
> 
> I recently needed a way to get backtraces from errors in a convenient,
> non-interactive and indescriminate way. The attached patch is the result.
> It teaches Pg to use libunwind to self-backtrace in elog/ereport.
> 
> Anyone think this is useful/interesting/worth pursuing?

I think we sorely need some mechanism to optionally get backtraces in
error messages.  I think having backtraces in all messages is definitely
not a good thing, but requiring an explicit marker (such as in my patch)
means the code has to be recompiled, which is not a solution in
production systems.  I kind lean towards your approach, but it has to be
something that's easily enabled/disabled at runtime.

I have no idea how expensive backtrace() and libunwind are, but I doubt
we want to pay the cost for every message before we know that error
requires the backtrace to be collected.  Something like PGC_USERSET
  server_min_backtraces=PANIC 
might be a possible interface.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Keeping temporary tables in shared buffers
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: partition -> partitioned