Thursday, November 3, 2011

LDAP VLV issue - workaround

Problem
If you have a LDAP instance running with VLV index, and piece of code using SDK trying to add more entries to this instance. The problem here is most of the SDK tools doesn't provide LDAP add operation with the VLV index update. So the entries doesn't show up any other program which is using the same LDAP instance with VLV. The fix here is to restart the LDAP instance after rebuilding all the indexes.
Not a recommended option.

Workaround
I was looking for solution and posted on stackoverflow...etc.
The workaround (not a solution) is to introduce another variable in the middle.
Set up another LDAP instance (Ltmp) which is in sync with the LDAP with VLV (Lvlv).
Modify the piece of code using the SDK to add LDAP entries to use the Ltmp instance.
The ldap sync operation between the LDAP instance takes care of the VLV issue.

I am sure there may be better way of doing this, but i simply couldn't find it.