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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, MauMau <maumau307(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] pg_ctl always uses the same event source
Date: 2014-01-23 21:08:32
Message-ID: CA+TgmoYq60C1w36DTun6ahPCA=7yRC6CYumbP2-ORd8CG+jSTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 23, 2014 at 9:23 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Jan 23, 2014 at 10:26 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
>>> On Wed, Jan 22, 2014 at 9:03 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> So? Anything which can know the value of a GUC parameter can certainly
>>>> know the selected port number.
>>
>>> 1. In case of registration of event source, either user has to pass the name
>>> or it uses hard coded default value, so if we use version number along with
>>> 'PostgreSQL', it can be consistent.
>>> I don't see any way pgevent.c can know port number to append it to default
>>> value, am I missing something here?
>>
>>
>> I think what we might want to do is redefine the server's behavior
>> as creating an event named after the concatenation of event_source
>> and port number, or maybe even get rid of event_source entirely and
>> just say it's "PostgreSQL" followed by the port number.
>
> To accomplish this behaviour, each time server starts and stops,
> we need to register and unregister event log using mechanism
> described at below link to ensure that there is no mismatch between
> what server uses and what OS knows.
> http://www.postgresql.org/docs/devel/static/event-log-registration.html

Why wouldn't that be necessary with your approach, too? I mean, if
there's a GUC that controls the event source name, then it can be
changed between restarts, regardless of what you call it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-23 21:09:41 Re: Why do we let autovacuum give up?
Previous Message Heikki Linnakangas 2014-01-23 21:04:43 Re: Re: [COMMITTERS] pgsql: Compress GIN posting lists, for smaller index size.