Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 87E1CB5DBD1 for ; Sun, 17 Jul 2011 13:54:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 50468-03 for ; Sun, 17 Jul 2011 16:54:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f174.google.com (mail-iy0-f174.google.com [209.85.210.174]) by mail.postgresql.org (Postfix) with ESMTP id 8AAB6B5DBC4 for ; Sun, 17 Jul 2011 13:54:16 -0300 (ADT) Received: by iyb12 with SMTP id 12so2480787iyb.19 for ; Sun, 17 Jul 2011 09:54:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.43.49.5 with SMTP id uy5mr6226285icb.293.1310921653998; Sun, 17 Jul 2011 09:54:13 -0700 (PDT) Received: by 10.43.52.130 with HTTP; Sun, 17 Jul 2011 09:54:13 -0700 (PDT) In-Reply-To: References: <27386.1310831992@sss.pgh.pa.us> <23808.1310851830@sss.pgh.pa.us> Date: Sun, 17 Jul 2011 09:54:13 -0700 Message-ID: Subject: Re: 9.0.4 Data corruption issue From: Ken Caruso To: =?ISO-8859-1?Q?C=E9dric_Villemain?= Cc: Tom Lane , "pgsql-admin@postgresql.org" Content-Type: multipart/alternative; boundary=bcaec5299ff183d2b704a846bb25 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201107/128 X-Sequence-Number: 37907 --bcaec5299ff183d2b704a846bb25 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sun, Jul 17, 2011 at 3:04 AM, C=E9dric Villemain < cedric.villemain.debian@gmail.com> wrote: > 2011/7/17 Ken Caruso : > > > > > > On Sat, Jul 16, 2011 at 2:30 PM, Tom Lane wrote: > >> > >> Ken Caruso writes: > >> > Sorry, the actual error reported by CLUSTER is: > >> > >> > gpup=3D> cluster verbose tablename; > >> > INFO: clustering "dbname.tablename" > >> > WARNING: could not write block 12125253 of base/2651908/652397108 > >> > DETAIL: Multiple failures --- write error might be permanent. > >> > ERROR: could not open file "base/2651908/652397108.1" (target block > >> > 12125253): No such file or directory > >> > CONTEXT: writing block 12125253 of relation base/2651908/652397108 > >> > >> Hmm ... it looks like you've got a dirty buffer in shared memory that > >> corresponds to a block that no longer exists on disk; in fact, the who= le > >> table segment it belonged to is gone. Or maybe the block or file numb= er > >> in the shared buffer header is corrupted somehow. > >> > >> I imagine you're seeing errors like this during each checkpoint attemp= t? > > > > Hi Tom, > > Thanks for the reply. > > Yes, I tried a pg_start_backup() to force a checkpoint and it failed du= e > to > > similar error. > > > >> > >> I can't think of any very good way to clean that up. What I'd try her= e > >> is a forced database shutdown (immediate-mode stop) and see if it star= ts > >> up cleanly. It might be that whatever caused this has also corrupted > >> the back WAL and so WAL replay will result in the same or similar erro= r. > >> In that case you'll be forced to do a pg_resetxlog to get the DB to co= me > >> up again. If so, a dump and reload and some manual consistency checki= ng > >> would be indicated :-( > > > > Before seeing this message, I restarted Postgres and it was able to get > to a > > consistent state at which point I reclustered the db without error and > > everything appears to be fine. Any idea what caused this? Was it > something > > to do with the Vacuum Full? > > Block number 12125253 is bigger that any block we can find in > base/2651908/652397108.1 > Should the table size be in the 100GB range or 2-3 GB range ? > This should help decide: if in the former case, then probably at least > a segment disappear or, in the later, the shared_buffer turn > corrupted. > > Ken, you didn't change RELSEG_SIZE, right ? (it needs to be change in > source code before compile it yourself) > In both case a hardware check is welcome I believe. > No I am using Pre-built Ubuntu binaries so no source changes. Hardware appears to be fine, the controller is a P800 on a HP DL380 and all the diagnostics indicate the disks, controller, and battery are doing well. Thanks -Ken > -- > C=E9dric Villemain 2ndQuadrant > http://2ndQuadrant.fr/ PostgreSQL : Expertise, Formation et Support > --bcaec5299ff183d2b704a846bb25 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Jul 17, 2011 at 3:04 AM, C=E9dri= c Villemain <cedric.villemain.debian@gmail.com> wrote:
2011/7/17 Ken Caruso <ken@ipl31.net= >:
>
>
> On Sat, Jul 16, 2011 at 2:30 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Ken Caruso <ken@ipl31.net&= gt; writes:
>> > Sorry, the actual error reported by CLUSTER is:
>>
>> > gpup=3D> cluster verbose tablename;
>> > INFO: =A0clustering "dbname.tablename"
>> > WARNING: =A0could not write block 12125253 of base/2651908/65= 2397108
>> > DETAIL: =A0Multiple failures --- write error might be permane= nt.
>> > ERROR: =A0could not open file "base/2651908/652397108.1&= quot; (target block
>> > 12125253): No such file or directory
>> > CONTEXT: =A0writing block 12125253 of relation base/2651908/6= 52397108
>>
>> Hmm ... it looks like you've got a dirty buffer in shared memo= ry that
>> corresponds to a block that no longer exists on disk; in fact, the= whole
>> table segment it belonged to is gone. =A0Or maybe the block or fil= e number
>> in the shared buffer header is corrupted somehow.
>>
>> I imagine you're seeing errors like this during each checkpoin= t attempt?
>
> Hi Tom,
> Thanks for the reply.
> Yes, I tried a pg_start_backup() to force a checkpoint and it failed d= ue to
> similar error.
>
>>
>> I can't think of any very good way to clean that up. =A0What I= 'd try here
>> is a forced database shutdown (immediate-mode stop) and see if it = starts
>> up cleanly. =A0It might be that whatever caused this has also corr= upted
>> the back WAL and so WAL replay will result in the same or similar = error.
>> In that case you'll be forced to do a pg_resetxlog to get the = DB to come
>> up again. =A0If so, a dump and reload and some manual consistency = checking
>> would be indicated :-(
>
> Before seeing this message, I restarted Postgres and it was able to ge= t to a
> consistent state at which point I reclustered the db without error and=
> everything appears to be fine. Any idea what caused this? Was it somet= hing
> to do with the Vacuum Full?

Block number 12125253 is bigger that any block we can find in base/2651908/652397108.1
Should the table size be in the 100GB range or 2-3 GB range ?
This should help decide: if in the former case, then probably at least
a segment disappear or, in the later, the shared_buffer turn
corrupted.

Ken, you didn't change RELSEG_SIZE, right ? (it needs to be change in source code before compile it yourself)
In both case a hardware check is welcome I believe.
No I am using Pre-built Ubuntu binaries so no source changes. = Hardware appears to be fine, the controller is a P800 on a HP DL380 and all= the diagnostics indicate the disks, controller, and battery are doing well= .=A0

Thanks

-Ken
=A0
--
C=E9dric Villemain=A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 2ndQuadrant
http://2ndQuadrant.fr/= =A0 =A0=A0 PostgreSQL : Expertise, Formation et Support

--bcaec5299ff183d2b704a846bb25--