https://bugzilla.redhat.com/show_bug.cgi?id=676053https://bugzilla.redhat.com/attachment.cgi?id=479245&action=diffhttps://bugzilla.redhat.com/attachment.cgi?id=479245&action=edit
Thanks to Rich for his comments. I've updated ldbm_back_search_cleanup
following his suggestions.
And thanks to Reinhard for his testing and reports. I've found 2 more places
entries are not released.
Description: There were 3 places where an entry was not released
by CACHE_RETURN (not decrimenting refcnt). If an entry has positive
refcnt in the entry cache, it won't be released even if the entry
never be accessed.
1. When a search request with VLV and/or SORT control fails.
2. When comparing entries in compare_entries_sv, and the second
entry is not found, the first entry is not released.
3. vlv_trim_candidates_byvalue retrieves entries for performing
binary search over the candidate list and put them into the cache.
They are not released.
This patch adds CACHE_RETURN call for the above cases.
https://bugzilla.redhat.com/show_bug.cgi?id=676053https://bugzilla.redhat.com/attachment.cgi?id=478729&action=diffhttps://bugzilla.redhat.com/attachment.cgi?id=478729&action=edit
Description: When Simple Paged Results is requested and a page is
returned, one entry is read ahead to check whether more entries
exist or not. The read-ahead retrieves an entry (if any) and adds
it into the entry cache. Simple Paged Results code puts the read-
ahead entry back, but there was missing to call cache_return for
the entry (that decrementing refcnt). If ldif2db.pl is called with
the cache state, it finds out the entry which is still referred.
This patch calls cache_return when the Simple Paged Results puts
the read-ahead entry back. Plus, adding a debug function dump_hash.
https://bugzilla.redhat.com/show_bug.cgi?id=676053https://bugzilla.redhat.com/attachment.cgi?id=478160&action=diffhttps://bugzilla.redhat.com/attachment.cgi?id=478160&action=edit
Description: Task version of export had a bug in handling the busy
instance error case. When returning due to the busy error, the
function ldbm_back_ldbm2ldif reset the busy bit set by other threads.
This patch checks the special return value set in the busy error
case and resets the busy bit only when it is set by the function.
Also, this patch fixes a bug in dse_add which replaces an adding
entry with its copy in pblock and the original entry is consumed.
But the caller frees the original entry. Applying this patch,
instead of consuming the original entry, its copy is consumed and
the original adding entry stays in the pblock.