Trac Ticket #335 - transaction retries need to be cache aware
https://fedorahosted.org/389/ticket/335
Fix description:
When libdb returns DEADLOCK and backend update function retries
the operation, the target entry is reset to the original shape.
The target entry might be or might not be in the entry cache.
Regardless of the status, the original code just releases the
entry with backentry_free before going into the next loop, which
causes the cache error.
This patch checks the status of the entry. If it is in the entry
cache, it removes it from the entry cache and adds a new entry
back to the cache if necessary. To get the accurate cache status
of each entry, the output argument cache_res to id2entry_add_ext
is added.
Additinally, error checking for the conflict value in index_add_mods
was week (curr_attr). This patch is adding the check.