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

Re: ObjectClass eq index corruption (ITS#1513)

>>>>> "Kurt" == Kurt D Zeilenga <Kurt@openldap.org> writes:

    Kurt> I note that some of your entries/searches appear to be of
    Kurt> the (uid=wataru_ryoke@bbol.jp) while others are
    Kurt> (uid=bcj_goodtime.jp).  While this shouldn't cause any
    Kurt> indexing problem, the inconsistency may cause use problems.

They were two different examples, actually, because the
bcj_goodtime.jp example was one that started to work again in the
middle of my bug report.

I've been getting wildly different behavior as time goes on, suggesting
some serious index corruption.  Sometimes some entries will work one
hour and not the next.

    Kurt> But, anyways, I suggest you rebuild your indices using
    Kurt> slapindex (while slapd is not running).  You might also want
    Kurt> to upgrade to the latest stable release (before running
    Kurt> slapindex).

I am trying this now.  What really irks me is that this behavior is
identical among all **6** of our LDAP machines (1 master, 5 replicas).
This suggests something really low-level is wrong with the indexing
code.  I hope you can take a look at the misbehaving DBs and indexes I


Anyway, I just tried running slapindex and it worked:

bash-2.03$ /usr/local/bin/ldapsearch -x -W -D cn=admin,o=gmo -h localhost -b o=gmo '(uid=*)' > /tmp/search1
Enter LDAP Password: 
bash-2.03$ /usr/local/bin/ldapsearch -x -W -D cn=admin,o=gmo -h localhost -b o=gmo '(&(objectClass=qmailuser)(uid=*))' > /tmp/search2

bash-2.03$ ls -l /tmp/search[12]
-rw-r--r--   1 ben      sysadmin 2032535 Jan  8 10:37 /tmp/search1
-rw-r--r--   1 ben      sysadmin 1867232 Jan  8 10:37 /tmp/search2

HUGE difference in the size of the queries, even though just about
every uid in the LDAP database is of objectClass qmailuser.  Now,
I run slapindex and do the exact same query (after shutting down
slapd and then restarting):


bash-2.03# /usr/local/sbin/slapindex

bash-2.03$ /usr/local/bin/ldapsearch -x -W -D cn=admin,o=gmo -h localhost -b o=gmo 'uid=*' > /tmp/index1
Enter LDAP Password: 
bash-2.03$ /usr/local/bin/ldapsearch -x -W -D cn=admin,o=gmo -h localhost -b o=gmo '(&(objectClass=qmailuser)(uid=*))' > /tmp/index2
Enter LDAP Password: 

bash-2.03# ls -l /tmp/index[12]
-rw-r--r--   1 ben      sysadmin 2032533 Jan  8 10:38 /tmp/index1
-rw-r--r--   1 ben      sysadmin 2016947 Jan  8 10:38 /tmp/index2

This is now about the right size, since most everyong with a uid
should also have objectClass qmailuser. (Not sure about that 2-byte
difference from the original first query, who knows.)

So, there is certainly some index corruption.  Would you like me to
send you a before-and-after set of indices to help debug this problem?
It seems rather nasty.


Brought to you by the letters L and O and the number 7.
"I wanna be Twist Barbie!"
Debian GNU/Linux maintainer of Gimp and Nethack -- http://www.debian.org/