Re: query log corrupted-looking entries

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: George Pavlov <gpavlov(at)mynewplace(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org, "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: query log corrupted-looking entries
Date: 2007-06-08 17:21:37
Message-ID: 20070608172137.GC9818@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Jun 08, 2007 at 09:30:21AM -0700, George Pavlov wrote:
> As to the full length of the entries that get
> interrupted they do seem to be all on the long side--I can't say with
> total certainty, but the couple of dozen that I looked at were all >
> 4096 when all the interruptions are taken out. So I think I can say that
> I see corruptions happen within "long" entries, but they can happen
> anywhere within that long entry, and one can have multiple interruptions
> within one entry.

That sounds about right. There's a requirement to be atomic for writes
less than PIPE_BUF, but for larger there are no guarentees at all. I
imagine the kernel noted the write was large and proceeded to fill the
last block of the buffer upto a round 4k. That would basically mean
they could get chopped into peices of any size.

Incidently, on systems I've worked with logging went through syslog and
it seems to split long lines at 80 characters or so:

[528-1] SELECT fo...
[528-2] ...
etc...

I always assumed it was postgres doing the splitting but perhaps it was
syslog all along.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Billings, John 2007-06-08 17:26:20 Using the power of the GPU
Previous Message Joshua D. Drake 2007-06-08 16:45:07 Re: Limitations on 7.0.3?

Browse pgsql-hackers by date

  From Date Subject
Next Message Billings, John 2007-06-08 17:55:23 Using the GPU
Previous Message Ed L. 2007-06-08 16:34:24 Re: query log corrupted-looking entries