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

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



It is certainly a bug in the 2.2 provider. Commenting out the code you 
mention in add.c will of course disable the persistent search function, 
so that is not a solution. The only suggestion I have is to migrate to 
2.3 as soon as feasible, since the syncrepl provider there does not have 
these problems.

Paolo.Rossi.IBM@h3g.it wrote:

>Full_Name: Paolo Rossi
>Version: 2.2.23
>OS: solaris linux darwin
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (62.13.170.12)
>
>
>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)
>
>Scenario:
>
>A simple producer and consumer configuration with consumer
>type=refreshAndPersist.
>
>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:
>
>searchbase="ou=people,o=example,c=it"  
>   or
>filter="(|(objectClass=organizationalUnit)(objectClass=inetOrgPerson))"
>
>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
>bdb_dn2entry("ou=people,o=h3g,c=it")
>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 ) {
>					Debug( LDAP_DEBUG_TRACE,
>						LDAP_XSTRING(bdb_add)
>						": persistent search failed "
>						"(%d,%d)\n",
>						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?
>
>Regards. 
>
>
>  
>


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