Re: Indexes getting corrupted.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-06-10 at 12:57 -0400, Tom Lane wrote:
> "Bruno G. Albuquerque" <balbuquerque@xxxxxxxxxx> 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
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,

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux