Re: Using ProcSignal to get memory context stats from a runningbackend

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Using ProcSignal to get memory context stats from a runningbackend
Дата
Msg-id 20171212185051.vqorvxo5cnmkiums@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Using ProcSignal to get memory context stats from a running backend  (Craig Ringer <craig@2ndquadrant.com>)
Ответы Re: Using ProcSignal to get memory context stats from a running backend  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 2017-12-12 14:25:48 +0800, Craig Ringer wrote:
> If we were willing to wrap variadic calls in a callback and rely on
> vfprintf, we could:

I don't think there's problems with relying on variadic calls, we do
that in plenty places.


> and let the ProcSignal based caller pass an elog wrapper instead, or form a
> StringInfo with appendStringInfoVA then elog it in one go after the
> MemoryContextStatsDetail call returns.

I don't think we want a simple elog wrapper - outputting the context
stats as hundreds of log messages doesn't seem right. So at the least it
seems we should bunch it up in stringinfo - which seems to at least
require expanding the API to pass around a void *callback_data or such.

I do wonder if the right thing here wouldn't be to put the result into a
dsm segment, and then return that to the UDF on the requesting
side. Logging to the server log and then have the requestor dig that out
doesn't seem particularly user friendly.

Greetings,

Andres Freund


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pgbench's expression parsing & negative numbers
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] parallel.c oblivion of worker-startup failures