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

(ITS#3572) Producer hang when complex searchbase or filter defined in consumer RefreshAndPersist

Full_Name: Paolo Rossi
Version: 2.2.23
OS: solaris linux darwin
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (

Tested on openLDAP 2.2.20 and 2.2.23, BerckleyDB 4.2.52 and 4.3.27
OS: Solaris 8, Linux 2.4.x/2.6.x,  Darwin (OS X)


A simple producer and consumer configuration with consumer

Usually I've noticed searchbase set to simple root ("o=example,c=it") and filter
set to all (objectClass=*),
but if searchbase and/or filter have some complexity, eg:


when consumer is running, producer hang at the first ldapadd operation (root
node yet created before).

In this condition, producer logs (debug 261) ends like:

oc_check_allowed type "cn"
oc_check_allowed type "subtreeSpecification"
oc_check_allowed type "contextCSN"
=> entry_encode(0x00000002): cn=ldapsync,o=h3g,c=it
=> bdb_search
search_candidates: base="ou=people,o=h3g,c=it" (0x00000004) scope=2
=> bdb_dn2idl( "ou=people,o=h3g,c=it" )
bdb_idl_fetch_key: @ou=people,o=h3g,c=it

note: =>bdb_search  appears only when ldapadd operation is performed with
consumer is running and configured with complex filter or searchbase.

also when hang, db_stat -Co report (if complex filter specified):

Locks grouped by object:
Locker   Mode      Count Status  ----------------- Object ---------------
80000013 WRITE         8 HELD    objectClass.bdb           page          1
       9 READ          1 WAIT    objectClass.bdb           page          1

       8 READ          1 HELD    objectClass.bdb           handle        0

if searchbase specified, WAIT is on dn2id.bdb

Now only kill -9 works on producer.

in back-bdb/add.c line 433:

			LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
				rc = bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_ADD );
				if ( rc ) {
						": persistent search failed "
						rc, rs->sr_err, 0 );

is executed only when consumer has those searchbase or filter set (and an add
operation on producer) then a search is performed and producer hang on :

back-bdb/idl.c line 519

rc = cursor->c_get( cursor, key, &data, flags | DB_SET );

I've tried to comment that "foreach" in add.c and the problem was disappear.

Maybe a bug?
Any suggestion?