Re: syslog_line_prefix - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: syslog_line_prefix
Date
Msg-id 4AC120FC.4080500@dunslane.net
Whole thread Raw
In response to Re: syslog_line_prefix  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> Alvaro Herrera wrote:
>>     
>>> syslog uses a nonblocking file descriptor without a retry loop to
>>> implement their logic.  I see no reason we couldn't do that ourselves.
>>> Mixing it with regular blocking code could turn out to be nontrivial,
>>> but I don't think it's impossible.
>>>       
>
>   
>> Well, for CSV logs it's a complete non-starter. We go to quite a deal of 
>> trouble to ensure we don't miss messages, because if we do the CSVs will 
>> be hopelessly corrupted.
>>     
>
> You could make it work if write() had all-or-nothing semantics, so that
> you could write or discard a whole logical message at once.  But I don't
> believe that's guaranteed for any interesting cases.
>
>         
>   

Right. That's part of why we had to invent the chunking protocol between 
the backends and the syslogger, IIRC.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] DefaultACLs
Next
From: Josh Berkus
Date:
Subject: Re: [PATCH] DefaultACLs