Unix Technical Forum

pipe chunks protocol

This is a discussion on pipe chunks protocol within the Pgsql Patches forums, part of the PostgreSQL category; --> This patch implements the protocol Tom suggested for writing to the syslogger pipe. It seems to pass my tests ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 11:14 AM
Andrew Dunstan
 
Posts: n/a
Default pipe chunks protocol


This patch implements the protocol Tom suggested for writing to the
syslogger pipe. It seems to pass my tests (basically "make installcheck"
against a server with stderr redirection turned on and log_statement set
to 'all').

The effect of this should be to prevent two problems:
.. partial messages get written to the log file, which messes with
rotation, and
.. messages from various backends get interleaved, causing garbled logs.

Please review ASAP. I want to get this applied soon so that a) it gets
wider testing and b) I can use it as the basis for the adapted CSV log
patch. If this is acceptable I intend to backpatch this all the way to
wherever we started using the syslogger pipe (was that 8.0?).

cheers

andrew


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 11:14 AM
Andrew Dunstan
 
Posts: n/a
Default Re: pipe chunks protocol


and here's the patch


Andrew Dunstan wrote:
>
> This patch implements the protocol Tom suggested for writing to the
> syslogger pipe. It seems to pass my tests (basically "make
> installcheck" against a server with stderr redirection turned on and
> log_statement set to 'all').
>
> The effect of this should be to prevent two problems:
> . partial messages get written to the log file, which messes with
> rotation, and
> . messages from various backends get interleaved, causing garbled logs.
>
> Please review ASAP. I want to get this applied soon so that a) it gets
> wider testing and b) I can use it as the basis for the adapted CSV log
> patch. If this is acceptable I intend to backpatch this all the way to
> wherever we started using the syslogger pipe (was that 8.0?).
>
> cheers
>
> andrew
>
>



---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 11:14 AM
Andrew Dunstan
 
Posts: n/a
Default Re: pipe chunks protocol



Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>>> This patch implements the protocol Tom suggested for writing to the
>>> syslogger pipe. It seems to pass my tests (basically "make
>>> installcheck" against a server with stderr redirection turned on and
>>> log_statement set to 'all').
>>>

>
> I didn't like this patch much --- it broke the API of
> write_syslogger_file, which is supposed to just write what it's given
> (and it is used from outside syslogger.c with that expectation). Also
> the way it slung unconsumed data back and forth between two buffers
> seemed both confusing and inefficient. Here's a revised version.
>


Well. it was like the curate's egg :-) Anyway, thanks for the cleanup.

> In my testing, I found that a standard "make installcheck" run produces
> only one message large enough to be split (the "infinite_recurse" thing
> in errors.sql), so this is definitely not a Good Enough test. Maybe
> we could get Ed L. or one of the other complainants to try it.


Yeah, what I did was to wind back the chunk size - try 128 and you'll
see plenty of chunked messages :-) But we really need to do this with
installcheck-parallel to exercise it properly.

> (The
> patch seems to need some adjustment to apply against 8.2, though.)
>
>
>


I know we normally try not to do this, but I'd be happy to wait for the
back branches in this case.

cheers

andrew




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 11:14 AM
Tom Lane
 
Posts: n/a
Default Re: pipe chunks protocol

Andrew Dunstan <andrew@dunslane.net> writes:
> Yeah, what I did was to wind back the chunk size - try 128 and you'll
> see plenty of chunked messages :-) But we really need to do this with
> installcheck-parallel to exercise it properly.


Doh, of course. I ran installcheck-parallel with log_statement = all
and the chunk size reduced to 64, and saw no apparent problems.
So that gives me at least enough confidence to apply it to HEAD.

>> (The
>> patch seems to need some adjustment to apply against 8.2, though.)


> I know we normally try not to do this, but I'd be happy to wait for the
> back branches in this case.


[confused...] How do you envision proceeding exactly?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-18-2008, 11:14 AM
Andrew Dunstan
 
Posts: n/a
Default Re: pipe chunks protocol



Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>
>> Yeah, what I did was to wind back the chunk size - try 128 and you'll
>> see plenty of chunked messages :-) But we really need to do this with
>> installcheck-parallel to exercise it properly.
>>

>
> Doh, of course. I ran installcheck-parallel with log_statement = all
> and the chunk size reduced to 64, and saw no apparent problems.
> So that gives me at least enough confidence to apply it to HEAD.
>
>
>>> (The
>>> patch seems to need some adjustment to apply against 8.2, though.)
>>>

>
>
>> I know we normally try not to do this, but I'd be happy to wait for the
>> back branches in this case.
>>

>
> [confused...] How do you envision proceeding exactly?
>
>
>


Never mind, if you're happy adapting and applying this right away to
back branches then I'm happy too. I just didn't want to have to wait
much before I start work on the CSVlog adaptation.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-18-2008, 11:14 AM
Tom Lane
 
Posts: n/a
Default Re: pipe chunks protocol

Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> [confused...] How do you envision proceeding exactly?


> Never mind, if you're happy adapting and applying this right away to
> back branches then I'm happy too. I just didn't want to have to wait
> much before I start work on the CSVlog adaptation.


Actually, I was hoping you'd adapt/apply to the back branches ;-)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 11:14 AM
Andrew Dunstan
 
Posts: n/a
Default Re: pipe chunks protocol



Tom Lane wrote:
>
> Actually, I was hoping you'd adapt/apply to the back branches ;-)
>
>
>


curses! foiled again!

OK, will do.

cheers

andrew

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:27 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com