On 1/31/20 9:10 PM, Jay Fenlason wrote:
I have a small FreeIPA deployment of ~6-8 servers running on Centos
7.7.  Do to the addition and removal of some of the servers, some
cruft (tombstones, replication conflicts, etc) have crept in to the
directory.  I noticed that when I attempted to delete some of the
cruft entries, ns-slapd would hang, failirg to process requests, or
even shut down.  In my investigation I found that pre-write callback
of the plugins (including the nis plugin) were being called, but no
corresponding post-write call was happening.  The nis plugin takes a
write lock in the pre-write callback and releases it in the post-write
callback.  Never releasing the lock causes the next attempt to take it
to hang.  I wrote the attached patch, which simply ensures the
post-write callback is always called if the pre-write callback was
called.

I need to look at this closer, but I would suspect you should not ignore the check for delete_tombstone_entry:

+    if (pre_delete_called) {

To

+    if (pre_delete_called || !delete_tombstone_entry) {


Does it still resolve your problem?  Probably, but best to check...

Like I said this needs a closer investigation/testing to make sure it does not 
cause any regressions.  Do you have a stack trace from the hang you 
encountered?  If not, could you get one for us?

Thanks,
Mark


This is such a simple patch that it scarcely needs a signoff.
Nonetheless:

Signed-off-by: Jay Fenlason <[email protected]>

--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c.orig   2020-01-31 
07:28:04.085861174 -0500
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c        2020-01-31 
07:30:33.932947489 -0500
@@ -81,6 +81,7 @@
      Connection *pb_conn;
      int32_t parent_op = 0;
      struct timespec parent_time;
+    int pre_delete_called = 0;
if (slapi_pblock_get(pb, SLAPI_CONN_ID, &conn_id) < 0) {
          conn_id = 0; /* connection is NULL */
@@ -371,6 +372,7 @@
                  }
                  if (retval == 0) {
                      retval = plugin_call_plugins(pb, 
SLAPI_PLUGIN_BE_PRE_DELETE_FN);
+                   pre_delete_called = 1;
                  }
                  if (retval)
                  {
@@ -1491,7 +1493,7 @@
       * The bepostop is called even if the operation fails,
       * but not if the operation is purging tombstones.
       */
-    if (!delete_tombstone_entry) {
+    if (pre_delete_called) {
          plugin_call_plugins(pb, SLAPI_PLUGIN_BE_POST_DELETE_FN);
      }
      /* Need to return to cache after post op plugins are called */
_______________________________________________
389-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

--

389 Directory Server Development Team
_______________________________________________
389-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to