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

Re: (ITS#4937) chain overlay bugs with Statslog & ldbm/ldif databases



h.b.furuseth@usit.uio.no wrote:
> Full_Name: Hallvard B Furuseth
> Version: RE23
> OS: Linux
> URL: 
> Submission from: (NULL) (129.240.202.105)
> Submitted by: hallvard
> 
> 
> overlay chain breaks with databases ldbm and ldif:
> 
> ./run -b {ldbm or ldif} test032-chain outputs:
>   ...
>   Starting second slapd on TCP/IP port 9012...
>   ...
>   Comparing "cn=Mark Elliot,ou=Alumni Association,ou=People,dc=example,dc=com"
> on port 9012...
>   ldapcompare failed (10)!
> 
> ldapcompare output in testrun/test.out:
>   Compare Result: Referral (10)
>   Matched DN: ou=People,dc=example,dc=com
>   Referral: ldap://localhost:9011/ou=People,dc=example,dc=com
>   UNDEFINED
> 
> testrun/slapd.1.log says the Compare was sent to the chained server, but
> with baseDN=<Matched DN above>:
>   ...
>   do_compare: dn (ou=People,dc=example,dc=com) attr (cn) value (mark elliot)
>   conn=5 op=2 CMP dn="ou=People,dc=example,dc=com" attr="cn"
>   ...
>   conn=5 op=2 RESULT tag=111 err=16 text=
>   ...
> 
> Slapcat says the Matched DN entry is correct (same as in a BDB run):
>   dn: ou=People,dc=example,dc=com
>   objectClass: referral
>   objectClass: extensibleObject
>   ou: People
>   ref: ldap://localhost:9011/ou=People,dc=example,dc=com
>   structuralObjectClass: referral
> 
> 
> Also the Statslog output is wrong for all three databases:
> 
> With LDBM and LDIF, the CMP operation is not logged, only its result:
>   grep '^conn=4' testrun/slapd.2.log # the ldapcompare operation above
>   conn=4 fd=14 ACCEPT from IP=127.0.0.1:45280 (IP=127.0.0.1:9012)
>   conn=4 op=0 BIND dn="" method=128
>   conn=4 op=0 RESULT tag=97 err=0 text=
>   conn=4 op=1 RESULT tag=111 err=10 text=
>   conn=4 op=2 UNBIND
>   conn=4 fd=14 closed
> 
> With BDB, the CMP operation is not logged, but both the returned
> result and the suppressed referral result is logged:
>   conn=4 fd=12 ACCEPT from IP=127.0.0.1:42190 (IP=127.0.0.1:9012)
>   conn=4 op=0 BIND dn="" method=128
>   conn=4 op=0 RESULT tag=97 err=0 text=
>   conn=4 op=1 RESULT tag=111 err=6 text=
>   conn=4 op=1 RESULT tag=111 err=10 text=
>   conn=4 op=2 UNBIND
>   conn=4 fd=12 closed
> 
> 
> I haven't tried other databases, but since two different databases
> had the same bug and same wrong Statlog, I'm guessing others do too.

This seems to be a known limitation, see the FIXME in slapd/compare.c, 
near SLAP_COMPARE_IN_FRONTEND. At least, that explains the problem for 
back-ldif, which does not provide its own compare entry point. As for 
back-ldbm, there is a missing referral_rewrite call in 
back-ldbm/referral.c. I don't consider it worthwhile to fix back-ldbm, 
but you're welcome to fix it if you wish. Just have a look at 
back-bdb/referral.c for the correct code.

-- 
   -- Howard Chu
   Chief Architect, Symas Corp.  http://www.symas.com
   Director, Highland Sun        http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP     http://www.openldap.org/project/