Re: [bug fix] pg_ctl always uses the same event source

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [bug fix] pg_ctl always uses the same event source
Дата
Msg-id CAA4eK1+RwOdPPH9Mir+5h-bd=PV2=zwn1tJk4fkcCUqf1HKWBw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [bug fix] pg_ctl always uses the same event source  ("MauMau" <maumau307@gmail.com>)
Ответы Re: [bug fix] pg_ctl always uses the same event source
Список pgsql-hackers
On Wed, Dec 11, 2013 at 8:31 PM, MauMau <maumau307@gmail.com> wrote:
>>> From: "Amit Kapila" <amit.kapila16@gmail.com>
>
> I re-considered that.  As you suggested, I think I'll do as follows.  Would
> this be OK?
>
> [pg_ctl.c]
> evtHandle = RegisterEventSource(NULL, *event_source ? event_source :
>    "PostgreSQL " PG_MAJORVERSION);
>
>
> [guc.c]
> {"event_source", PGC_POSTMASTER, LOGGING_WHERE,
> ...
> "PostgreSQL " PG_MAJORVERSION,
> NULL, NULL, NULL
  This is similar to what I had in mind.

>
> [elog.c]
> Writing the default value in this file was redundant, because event_source
> cannot be NULL.  So change
>
>
> evtHandle = RegisterEventSource(NULL, event_source ? event_source :
> "PostgreSQL");
>
> to
>
> evtHandle = RegisterEventSource(NULL, event_source);

I think this change might not be safe as write_eventlog() gets called
from write_stderr() which might get called
before reading postgresql.conf, so the code as exists in PG might be
to handle that case or some other similar
situation where event_source is still not set. Have you confirmed in
all ways that it is never the case that
event_source is not set when the control reaches this function.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Extra functionality to createuser
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation