From: Simon Riggs <simon@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruno G. Albuquerque <balbuquerque@dba.com.br>
Cc: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Indexes getting corrupted.
Date: Thu, 16 Jun 2005 10:05:41 +0100
Message-ID: <1118912741.3645.206.camel@localhost.localdomain> (raw)
In-Reply-To: <23641.1118422679@sss.pgh.pa.us>
References: <42A73B60.7010909@dba.com.br>
<1118258780.5758.160.camel@state.g2switchworks.com>
<42A9C2F7.50306@dba.com.br>
<23641.1118422679@sss.pgh.pa.us>
On Fri, 2005-06-10 at 12:57 -0400, Tom Lane wrote:
> "Bruno G. Albuquerque" <balbuquerque@dba.com.br> writes:
> > Any pointers? Is there anything I can do for Windows to actually wait
> > for the postgresql processes to clean up?
>
> What it looks like to me is that your disk drive is lying about what
> it's actually written; or possibly Windows is lying to Postgres about
> what it's actually written. The former is pretty common and can usually
> be fixed by turning off write caching.
Possibly. But why would this effect only indexes?
This is the same error that was also reported on GENERAL recently on
8.0.1.
I'm suspicious of a more subtle intermittent error. We have no
information about what the magic values are, only that they are not
correct. Should we increase the information returned for that error?
That might show up an error cause.
Best Regards, Simon Riggs
Attachments:btmetainfo.patch (text/x-patch, 2.5K) download
Index: backend/access/nbtree/nbtpage.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/nbtree/nbtpage.c,v
retrieving revision 1.86
diff -c -c -r1.86 nbtpage.c
*** backend/access/nbtree/nbtpage.c 6 Jun 2005 20:22:57 -0000 1.86
--- backend/access/nbtree/nbtpage.c 16 Jun 2005 09:01:15 -0000
***************
*** 169,180 ****
metad = BTPageGetMeta(metapg);
/* sanity-check the metapage */
! if (!(metaopaque->btpo_flags & BTP_META) ||
! metad->btm_magic != BTREE_MAGIC)
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree",
! RelationGetRelationName(rel))));
if (metad->btm_version != BTREE_VERSION)
ereport(ERROR,
--- 169,187 ----
metad = BTPageGetMeta(metapg);
/* sanity-check the metapage */
! if (!(metaopaque->btpo_flags & BTP_META))
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree: opaque flags %d",
! RelationGetRelationName(rel),
! metaopaque->btpo_flags)));
!
! if (metad->btm_magic != BTREE_MAGIC)
! ereport(ERROR,
! (errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree: magic value %d",
! RelationGetRelationName(rel),
! metad->btm_magic)));
if (metad->btm_version != BTREE_VERSION)
ereport(ERROR,
***************
*** 350,361 ****
metaopaque = (BTPageOpaque) PageGetSpecialPointer(metapg);
metad = BTPageGetMeta(metapg);
! if (!(metaopaque->btpo_flags & BTP_META) ||
! metad->btm_magic != BTREE_MAGIC)
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree",
! RelationGetRelationName(rel))));
if (metad->btm_version != BTREE_VERSION)
ereport(ERROR,
--- 357,376 ----
metaopaque = (BTPageOpaque) PageGetSpecialPointer(metapg);
metad = BTPageGetMeta(metapg);
! /* sanity-check the metapage */
! if (!(metaopaque->btpo_flags & BTP_META))
ereport(ERROR,
(errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree: opaque flags %d",
! RelationGetRelationName(rel),
! metaopaque->btpo_flags)));
!
! if (metad->btm_magic != BTREE_MAGIC)
! ereport(ERROR,
! (errcode(ERRCODE_INDEX_CORRUPTED),
! errmsg("index \"%s\" is not a btree: magic value %d",
! RelationGetRelationName(rel),
! metad->btm_magic)));
if (metad->btm_version != BTREE_VERSION)
ereport(ERROR,
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: simon@2ndquadrant.com, tgl@sss.pgh.pa.us, balbuquerque@dba.com.br, smarlowe@g2switchworks.com
Subject: Re: Indexes getting corrupted.
In-Reply-To: <1118912741.3645.206.camel@localhost.localdomain>
References: <42A73B60.7010909@dba.com.br> <1118258780.5758.160.camel@state.g2switchworks.com> <42A9C2F7.50306@dba.com.br> <23641.1118422679@sss.pgh.pa.us> <1118912741.3645.206.camel@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox