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

back-bdb slapadd

I've just committed a change to back-bdb/tools.c that causes it to "sort" its
input for slapadd. That is, if you try to slapadd an entry whose parent
doesn't exist yet, it will first (recursively) add the parent DN to the dn2id
index. I did not #ifdef this new behavior, though perhaps we should.

It is potentially slower now, since it does a dn2id lookup on each DN, before
assigning an ID to a new entry. I suspect this difference is trivial, but it
bears mentioning.

For a well-ordered input file, the new code yields the same database as the
old code, so there should be no backward compatibility issue there. The test
suite runs with the same results as before.

For an unsorted file, there is the potential to leave "holes" in the
database - it may create a parent node in the dn2id index, but the LDIF input
might not supply the actual parent entry. There is no detection of this
condition, and a subsequent attempt to ldapadd the missing parent would fail
with "DN already exists" or somesuch. (Adding the missing parent with slapadd
would succeed, though.)


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