#50748 Ticket 50745: ns-slapd hangs during CleanAllRUV tests
Closed by spichugi. Opened by tbordaz.
tbordaz/389-ds-base ticket_50745  into  master

Download 50748.patch

Bug Description:
The hang condition:
- is not systematic
- occurs in rare case, for example here during the deletion of a replica.
- a thread is waiting for a dblock that an other thread "forgot" to
release.
- have always existed, at least since 1.4.0 but likely since 1.2.x

When deleting a replica, the replica is retrieved from
mapping tree structure (mtnode).
The replica is also retrieved through the mapping tree
when writing updates to the changelog.
When deleting the replica, mapping tree structure is cleared
after the changelog is deleted (that can take some cycles).
There is a window where an update can retrieve the replica,
from the not yet cleared MT, while the changelog being removed.
At the end, the update will update the changelog that is
currently removed and keeps an unfree lock in the DB.

Fix description:
Ideally mapping tree should be protected by a lock but it
is not done systematically (e.g. slapi_get_mapping_tree_node).
Using a lock looks an overkill and can probably introduce
deadlock and performance hit.
The idea of the fix is to reduce the window, moving the
mapping tree clear before the changelog removal.

https://pagure.io/389-ds-base/issue/50745

Reviewed by: ?

@mreynolds thanks for the review. The PR is done on behalf of @lkrispen who identified the fix. Let's wait for @lkrispen feedback as I know he tried to improve testcase to get an almost systematic reproducer.

rebased onto 1f775187e7d9ddee19def4d50f8a061c4f6be5be

you have my ack as well

rebased onto 7c3c10da285b3e7478c81a6d891381ee62b9aa1f

Pull-Request has been merged by tbordaz

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3803

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata