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

Re: back-bdb quirk?



I looked at this yesterday and I could reproduce a similar error condition.

The first order reason to this error looks like the numbers of cursor open
and close do not match.
Therefore, transaction commit or prepare complains about non-zero cursor
count for the transaction.

It seems to me that this problem comes from IDL larger than its limit.
(BDB_IDL_DB_SIZE)
When I increased BDB_IDL_DB_SIZE, I could pass the point of error during
slapadd.
The memory layout of IDL needs attention.

- Jong

------------------------
Jong Hyuk Choi
IBM Thomas J. Watson Research Center - Enterprise Linux Group
P. O. Box 218, Yorktown Heights, NY 10598
email: jongchoi@us.ibm.com
(phone) 914-945-3979    (fax) 914-945-4425   TL: 862-3979


"Pierangelo Masarati" <masarati@aero.polimi.it> on 03/06/2002 04:08:28 AM

To:    Jonghyuk Choi/Watson/IBM@IBMUS
cc:
Subject:    Re: back-bdb quirk?



Jonghyuk Choi writes:

>
> Can you send me the ldif file used ?
> And, what was the error message ?

Hi.

The ldif file contains proprietary and sensitive data, but
the problem barely depends on the number of entries that are
added in one shot.  You can generate a viable ldif file with
the following script

<SCRIPT>
#!/bin/sh

NC="dc=example,dc=com"

echo "dn: $NC"
echo "objectClass: top"
echo "objectClass: organization"
echo "objectClass: dcObject"
echo "o: Example"
echo "dc: example"
echo ""

echo "dn: ou=People,$NC"
echo "objectClass: top"
echo "objectClass: organizationalUnit"
echo "ou: People"
echo ""

i=0
while test $i -lt 16384 ; do
       printf "dn: uid=%05d,ou=People,$NC\n" $i
       echo "objectClass: top"
       echo "objectClass: person"
       echo "objectClass: organizationalPerson"
       echo "objectClass: inetOrgPerson"
       echo "objectClass: inetLocalMailRecipient"
       printf "cn: %05d\n" $i
       printf "sn: %05d\n" $i
       printf "uid: %05d\n" $i
       printf "mail: %05d@example.com\n" $i
       printf "mailLocalAddress: %05d@example.com\n" $i
       printf "mailRoutingAddress: %05d@mail.example.com\n" $i
       echo ""

       i=`expr $i + 1`
done
</SCRIPT>

You need misc.schema in your slapd.conf to use
the inetLocalMailRecipient o.c.

The error I get from slapadd (ran with -v -d -1) is
(last successful add + error)

<LOG>
=> str2entry
>>> dnPrettyNormal: <uid=16381,ou=People,dc=example,dc=com>
<<< dnPrettyNormal: <uid=16381,ou=People,dc=example,dc=com>,
<uid=16381,ou=PEOPL
E,dc=EXAMPLE,dc=COM>
<= str2entry(uid=16381,ou=People,dc=example,dc=com) -> 0x811eb78
is_object_subclass(2.5.6.6,2.5.6.7) 0
is_object_subclass(2.5.6.6,2.5.6.6) 1
is_object_subclass(2.5.6.7,2.16.840.1.113730.3.2.2) 0
is_object_subclass(2.5.6.7,2.5.6.7) 1
is_object_subclass(2.5.6.6,2.5.6.7) 0
is_object_subclass(2.5.6.6,2.5.6.6) 1
is_object_subclass(2.5.6.7,2.16.840.1.113730.3.2.2) 0
is_object_subclass(2.5.6.7,2.5.6.7) 1
oc_check_required entry (uid=16381,ou=People,dc=example,dc=com),
objectClass
"in
etOrgPerson"
oc_check_required entry (uid=16381,ou=People,dc=example,dc=com),
objectClass
"in
etLocalMailRecipient"
oc_check_allowed type "objectClass"
oc_check_allowed type "cn"
oc_check_allowed type "sn"
oc_check_allowed type "uid"
oc_check_allowed type "mail"
oc_check_allowed type "mailLocalAddress"
oc_check_allowed type "mailRoutingAddress"
oc_check_allowed type "structuralObjectClass"
=> bdb_tool_entry_put( -1, "uid=16381,ou=People,dc=example,dc=com" )
=> bdb_dn2id_add( "uid=16381,ou=PEOPLE,dc=EXAMPLE,dc=COM", 0x00004000 )
<= bdb_dn2id_add: 0
=> entry_encode(0x00004000): uid=16381,ou=People,dc=example,dc=com
=> index_entry_add( 16384, "uid=16381,ou=People,dc=example,dc=com" )
=> key_change(ADD,4000)
<= key_change 0
=> key_change(ADD,4000)
<= key_change 0
=> key_change(ADD,4000)
<= key_change 0
=> key_change(ADD,4000)
<= key_change 0
=> key_change(ADD,4000)
<= key_change 0
<= index_entry_add( 16384, "uid=16381,ou=People,dc=example,dc=com" )
success
bdb(dc=example,dc=com): transaction has active cursors
bdb(dc=example,dc=com): PANIC: Invalid argument
=> bdb_tool_entry_put: txn_commit failed: DB_RUNRECOVERY: Fatal error, run
datab
ase recovery (-30981)
slapadd: could not add entry dn="uid=16381,ou=People,dc=example,dc=com"
(line=21
2978): txn_commit failed: DB_RUNRECOVERY: Fatal error, run database
recovery
(-3
0981)
slapadd shutdown: initiated
====> bdb_cache_release_all
slapadd shutdown: freeing system resources.
bdb_db_destroy: txn_checkpoint failed: DB_RUNRECOVERY: Fatal error, run
database
recovery (-30981)
====> bdb_cache_release_all
bdb_db_destroy: close failed: DB_RUNRECOVERY: Fatal error, run database
recovery
(-30981)
</LOG>

The significant portion of my slapd.conf was

<CONF>
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/misc.schema

database        bdb
suffix          "dc=example,dc=com"
rootdn          "cn=LDAP Manager,dc=example,dc=com"
rootpw          secret
directory       /var/openldap-data/mailhub-anon

index   objectClass     eq
</CONF>

Bye, Ando.

Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 |
mailto:pierangelo.masarati@polimi.it
via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati