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

RE: compare uidNumber in LDAP



Delete and add still has a race condition.  While delete & add is atomic,
reading the old uidNumber isn't part of that.  Example-

Process A reads uidNumber 500
Process B reads uidNumber 500
Process A deletes & adds uidNumber 501 before B continues
Process B deletes & adds uidNumber 501

So now you have two identical uids.

Answer:
Create a lock record (such as dn: cn=maxUidLock,dc=example,dc=com)
Read uidNumber record
Modify uidNumber record
Delete lock record

If you cannot create a lock record, then wait and retry.

-y

~~~~~
The Moon is Waning Gibbous (84% of Full)