#50556 Issue 49624 - modrdn silently fails if DB deadlock occurs
Closed 3 years ago by spichugi. Opened 4 years ago by mreynolds.
mreynolds/389-ds-base issue49624  into  master

@@ -251,7 +251,7 @@ 

              slapi_pblock_get(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, &dn_newsuperiordn);

              slapi_sdn_free(&dn_newsuperiordn);

              slapi_pblock_set(pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, orig_dn_newsuperiordn);

-             orig_dn_newsuperiordn = slapi_sdn_dup(orig_dn_newsuperiordn);

+             dn_newsuperiordn = slapi_sdn_dup(orig_dn_newsuperiordn);

              /* must duplicate ec before returning it to cache,

               * which could free the entry. */

              if ((tmpentry = backentry_dup(original_entry ? original_entry : ec)) == NULL) {

Bug Description:

If a DB Deadlock error occurs during a modrdn operation the entry cache gets updated (corrupted), but the update is not applied to the database.

Fix Description:

Looks like there was a copy & paste error, and the wrong attribute was updated during the retry of the modrdn operation.

relates: https://pagure.io/389-ds-base/issue/49624

the old code definitely looks wrong and your fix looks good, I cannot tell if this will fix the cache corruption, but I think it is likely.

So ack to commit this patch

the old code definitely looks wrong and your fix looks good, I cannot tell if this will fix the cache corruption, but I think it is likely.

Well what happens is that the operation is reported as success and if you search for the new entry you find it. But the database was never updated. If you restart the server you will see the update was not applied. So basically the cache should not have been updated, but by fixing the variable everything works as expected. If you try to update the phantom entry weird things happen - typically an error 1.

rebased onto b5d9627

4 years ago

Pull-Request has been merged by mreynolds

4 years ago

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/3612

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

3 years ago
Metadata