Bug 711679 - unresponsive LDAP service when deleting vlv on replica
https://bugzilla.redhat.com/show_bug.cgi?id=711679
Bug Description:
When a vlv index is created, a newly generated vlv index object
is linked in the vlv search list. If the server is under stress,
there could be some contention among threads and each thread
could add an identical vlv index object to the list, which leads
to open the vlv index db more than once - count of the objects.
Opening a db file locks it with a READ lock. Deleting the vlv
index first closes the db which is supposed to release the READ
lock. But since the db is opened more than once, still some READ
lock remains. And the deleter's attempt to lock the db with WRITE
lock is kept waiting for the READ lock released, that never happens.
Fix Description:
Check the vlv index object before adding it to the vlv search list.
If the identical object is found in the list, adding is skipped.
(cherry picked from commit 25687041f157da911bee039dbf01f76bdfcc518d)