With the new LMDB cache code, objects with zero registered handlers are not removed from the cache any longer if they contain child objects in the dntree. Reproducible on a Master with S4-Connector: ## 1. Preparation to initialize the cache as usual, ## this is not required if the system is installed/updated normally ucr unset connector/s4/listener/disabled service univention-directory-listener stop /usr/sbin/univention-directory-listener -F -d 2 -b dc=ar41i1,dc=qa -m /usr/lib/univention-directory-listener/system -c /var/lib/univention-directory-listener -ZZ -x -D cn=admin,dc=ar41i1,dc=qa -y /etc/ldap.secret -g -i ## 2. Resync all modules: ucr set connector/s4/listener/disabled=yes service univention-directory-listener stop rm /var/lib/univention-directory-listener/handlers/* /usr/sbin/univention-directory-listener -F -d 2 -b dc=ar41i1,dc=qa -m /usr/lib/univention-directory-listener/system -c /var/lib/univention-directory-listener -ZZ -x -D cn=admin,dc=ar41i1,dc=qa -y /etc/ldap.secret -i ## Since replication.py is not present on the Master, the s4-connector handler ## seems to be the only one that was registered on container objects. Since ## we disabled that module, they are not removed any longer 09.03.17 11:34:12.772 LISTENER ( WARN ) : initializing module s4-connector 09.03.17 11:34:12.773 LISTENER ( ERROR ) : dntree_del_id: delete failed: subordinate objects must be deleted first 09.03.17 11:34:12.773 LISTENER ( ERROR ) : cache_delete_entry: aborting delete: dc=ar41i1,dc=qa 09.03.17 11:34:12.774 LISTENER ( ERROR ) : dntree_del_id: delete failed: subordinate objects must be deleted first 09.03.17 11:34:12.774 LISTENER ( ERROR ) : cache_delete_entry: aborting delete: cn=computers,dc=ar41i1,dc=qa 09.03.17 11:34:12.774 LISTENER ( ERROR ) : dntree_del_id: delete failed: subordinate objects must be deleted first 09.03.17 11:34:12.774 LISTENER ( ERROR ) : cache_delete_entry: aborting delete: cn=dc,cn=computers,dc=ar41i1,dc=qa 09.03.17 11:34:12.775 LISTENER ( ERROR ) : dntree_del_id: delete failed: subordinate objects must be deleted first 09.03.17 11:34:12.775 LISTENER ( ERROR ) : cache_delete_entry: aborting delete: cn=builtin,dc=ar41i1,dc=qa 09.03.17 11:34:12.775 LISTENER ( ERROR ) : dntree_del_id: delete failed: subordinate objects must be deleted first Index: src/cache.c =================================================================== --- src/cache.c (Revision 77488) +++ src/cache.c (Arbeitskopie) @@ -560,13 +560,8 @@ } rv = dntree_del_id(*id2dn_cursor_pp, dnid); - if (rv != MDB_SUCCESS) { - signals_unblock(); - return rv; - } signals_unblock(); - return rv; } Index: src/cache_dn.c =================================================================== --- src/cache_dn.c (Revision 77393) +++ src/cache_dn.c (Arbeitskopie) @@ -317,7 +353,9 @@ dbi = mdb_cursor_dbi(write_cursor_p); rv = mdb_cursor_open(txn, dbi, &local_read_cursor_p); if (rv != MDB_SUCCESS) { - univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "%s: mdb_cursor_open: %s (%d)", __func__, ldap_err2string(rv), rv); + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, + "%s: mdb_cursor_open: %s (%d)", + __func__, ldap_err2string(rv), rv); abort(); return rv; } @@ -324,12 +362,15 @@ rv = dntree_has_children(local_read_cursor_p, dnid); if (rv == MDB_SUCCESS) { - univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "%s: delete failed:" - " subordinate objects must be deleted first", + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO, + "%s: delete failed:" + " subordinate objects must be deleted first", __func__); - return -1; + return MDB_SUCCESS; } else if (rv != MDB_NOTFOUND) { - univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "%s: dntree_has_children failed: %s (%d)", __func__, mdb_strerror(rv), rv); + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, + "%s: dntree_has_children failed: %s (%d)", + __func__, mdb_strerror(rv), rv); abort(); return -1; } @@ -344,11 +385,24 @@ rv = mdb_cursor_get(write_cursor_p, &key, &data, MDB_SET); if (rv == MDB_SUCCESS) { rv = mdb_cursor_del(write_cursor_p, 0); + if (rv != MDB_SUCCESS) + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, + "%s: failed for node id=%lu: %s (%d)", + __func__, dnid, mdb_strerror(rv), rv); + abort(); + } } + } else { + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, + "%s: failed for link id=%lu: %s (%d)", + __func__, dnid, mdb_strerror(rv), rv); + abort(); } if (rv == MDB_SUCCESS) { - univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO, "%s: deleted id=%lu", __func__, dnid); + univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_INFO, + "%s: deleted id=%lu", + __func__, dnid); } return rv;