[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: bdb corruption



> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Matthew
Schumacher

> Howard,
>
> How did you find your hash buckets and over pages for the objectClass
index?
>
> My system returns:
>
> #db_stat -d /usr/local/var/openldap-data/objectClass.bdb
> 53162   Btree magic number.
> 9       Btree version number.
> Flags:  multiple-databases
> 2       Minimum keys per-page.
> 4096    Underlying database page size.
> 0       Number of levels in the tree.
> 0       Number of unique keys in the tree.
> 0       Number of data items in the tree.
> 0       Number of tree internal pages.
> 0       Number of bytes free in tree internal pages (0% ff).
> 0       Number of tree leaf pages.
> 0       Number of bytes free in tree leaf pages (0% ff).
> 0       Number of tree duplicate pages.
> 0       Number of bytes free in tree duplicate pages (0% ff).
> 0       Number of tree overflow pages.
> 0       Number of bytes free in tree overflow pages (0% ff).
> 0       Number of pages on the free list.

In OpenLDAP 2.1 the index files use subdatabases. (This turned out to be a
bad idea, and OpenLDAP 2.2 no longer uses them.) To get the stats you're
interested in, you have to use the "-s" option in addition to "-d" :
	db_stat -d objectClass.bdb -s objectClass

If you're at liberty to delete and rebuild your indexes it would be
worthwhile to patch your 2.1 code to turn off subdatabases as well. Using
them is known to cause deadlocks on multiprocessor machines, among other
issues. The patch was never committed to the 2.1 source tree because it would
be an incompatible database format change. In back-bdb/dbcache.c, about line
135:

        rc = DB_OPEN( db->bdi_db, tid,
                file, name,
                DB_HASH, flags,
                bdb->bi_dbenv_mode );

replace "name" with "NULL" and recompile. All of your indexes will need to be
deleted and recreated.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support