Re: [HACKERS] Patch to implement pg_current_logfile() function - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Patch to implement pg_current_logfile() function
Date
Msg-id CAB7nPqSMivo2igA_pF26RDwh1JC0ypMuwKeNVEFu7m8b+72Ubw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Patch to implement pg_current_logfile() function  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: [HACKERS] Patch to implement pg_current_logfile() function  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: [HACKERS] Patch to implement pg_current_logfile() function  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Jan 20, 2017 at 3:29 AM, Karl O. Pinc <kop@meme.com> wrote:
> On Thu, 19 Jan 2017 12:12:18 -0300
> Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
>> Karl O. Pinc wrote:
>> > On Wed, 18 Jan 2017 19:27:40 -0300
>> > Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>>
>> > > I thought this part was odd -- I mean, why is SysLogger_Start()
>> > > being called if the collector is not enabled?  Turns out we do it
>> > > and return early if not enabled.  But not in all cases -- there
>> > > is one callsite in postmaster.c that avoids the call if the
>> > > collector is disabled. That needs to be changed if we want this
>> > > to work reliably.
>> >
>> > Is this an argument for having the current_logfiles always exist
>> > and be empty when there is no in-filesystem logfile?  It always felt
>> > to me that the code would be simpler that way.
>>
>> I don't know.  I am just saying that you need to patch postmaster.c
>> line 1726 to remove the second arm of the &&.
>
> Gilles,
>
> I'm not available just now.  Can you do this or enlist Michael?

Okay I just did it. At the same time the check for ferror is not
necessary as fgets() returns NULL on an error as well so that's dead
code. I have also removed the useless call to FreeFile().
-- 
Michael

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: [HACKERS] Too many autovacuum workers spawned during forced auto-vacuum
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] pg_hba_file_settings view patch