]> git.sur5r.net Git - openldap/commitdiff
Log errors from dn2id failures
authorHoward Chu <hyc@openldap.org>
Wed, 30 Apr 2003 07:47:24 +0000 (07:47 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 30 Apr 2003 07:47:24 +0000 (07:47 +0000)
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modrdn.c

index 2d5302e64ca666520a2bd26d07eaba7b757adce0..ad44e858ace172b2b8af712d4de99dbb54fbc8e0 100644 (file)
@@ -361,19 +361,20 @@ retry:    /* transaction retry */
        rs->sr_err = bdb_dn2id_delete( op->o_bd, lt2, eip, e,
                op->o_tmpmemctx );
        if ( rs->sr_err != 0 ) {
-               switch( rs->sr_err ) {
-               case DB_LOCK_DEADLOCK:
-               case DB_LOCK_NOTGRANTED:
-                       goto retry;
-               }
 #ifdef NEW_LOGGING
                LDAP_LOG ( OPERATION, ERR, 
-                       "<=- bdb_delete: dn2id failed %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 );
+                       "<=- bdb_delete: dn2id failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
 #else
-               Debug(LDAP_DEBUG_ARGS,
+               Debug(LDAP_DEBUG_TRACE,
                        "<=- bdb_delete: dn2id failed: %s (%d)\n",
                        db_strerror(rs->sr_err), rs->sr_err, 0 );
 #endif
+               switch( rs->sr_err ) {
+               case DB_LOCK_DEADLOCK:
+               case DB_LOCK_NOTGRANTED:
+                       goto retry;
+               }
                rs->sr_text = "DN index delete failed";
                rs->sr_err = LDAP_OTHER;
                goto return_results;
@@ -382,20 +383,20 @@ retry:    /* transaction retry */
        /* delete from id2entry */
        rs->sr_err = bdb_id2entry_delete( op->o_bd, lt2, e );
        if ( rs->sr_err != 0 ) {
-               switch( rs->sr_err ) {
-               case DB_LOCK_DEADLOCK:
-               case DB_LOCK_NOTGRANTED:
-                       goto retry;
-               }
 #ifdef NEW_LOGGING
                LDAP_LOG ( OPERATION, ERR, 
                        "<=- bdb_delete: id2entry failed: %s (%d)\n", 
                        db_strerror(rs->sr_err), rs->sr_err, 0 );
 #else
-               Debug(LDAP_DEBUG_ARGS,
+               Debug(LDAP_DEBUG_TRACE,
                        "<=- bdb_delete: id2entry failed: %s (%d)\n",
                        db_strerror(rs->sr_err), rs->sr_err, 0 );
 #endif
+               switch( rs->sr_err ) {
+               case DB_LOCK_DEADLOCK:
+               case DB_LOCK_NOTGRANTED:
+                       goto retry;
+               }
                rs->sr_text = "entry delete failed";
                rs->sr_err = LDAP_OTHER;
                goto return_results;
@@ -404,18 +405,20 @@ retry:    /* transaction retry */
        /* delete indices for old attributes */
        rs->sr_err = bdb_index_entry_del( op, lt2, e );
        if ( rs->sr_err != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_delete: index failed: %s (%d)\n", 
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#else
+               Debug( LDAP_DEBUG_TRACE,
+                       "<=- bdb_delete: index failed: %s (%d)\n", 
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#endif
                switch( rs->sr_err ) {
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED:
                        goto retry;
                }
-#ifdef NEW_LOGGING
-               LDAP_LOG ( OPERATION, ERR, 
-                       "<=- bdb_delete: entry index delete failed!\n", 0, 0, 0 );
-#else
-               Debug( LDAP_DEBUG_ANY, "entry index delete failed!\n",
-                       0, 0, 0 );
-#endif
                rs->sr_text = "entry index delete failed";
                rs->sr_err = LDAP_OTHER;
                goto return_results;
index f7343ccf6ed5ccc2ca4bb89dc2ea2a34cbc70888..59cf33efcfd12e26c7a721ea98cf1420e0b2ffbc 100644 (file)
@@ -778,6 +778,15 @@ retry:     /* transaction retry */
        rs->sr_err = bdb_dn2id_delete( op->o_bd, lt2, eip, e,
                op->o_tmpmemctx );
        if ( rs->sr_err != 0 ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_modrdn: dn2id del failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#else
+               Debug(LDAP_DEBUG_TRACE,
+                       "<=- bdb_modrdn: dn2id del failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#endif
                switch( rs->sr_err ) {
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED:
@@ -815,6 +824,15 @@ retry:     /* transaction retry */
        rs->sr_err = bdb_dn2id_add( op->o_bd, lt2, neip ? neip : eip, e,
                op->o_tmpmemctx );
        if ( rs->sr_err != 0 ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_modrdn: dn2id add failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#else
+               Debug(LDAP_DEBUG_TRACE,
+                       "<=- bdb_modrdn: dn2id add failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#endif
                switch( rs->sr_err ) {
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED:
@@ -838,6 +856,15 @@ retry:     /* transaction retry */
                &rs->sr_text, textbuf, textlen );
 
        if( rs->sr_err != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_modrdn: modify failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#else
+               Debug(LDAP_DEBUG_TRACE,
+                       "<=- bdb_modrdn: modify failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#endif
                if ( ( rs->sr_err == LDAP_INSUFFICIENT_ACCESS ) && opinfo.boi_err ) {
                        rs->sr_err = opinfo.boi_err;
                }
@@ -852,6 +879,15 @@ retry:     /* transaction retry */
        /* id2entry index */
        rs->sr_err = bdb_id2entry_update( op->o_bd, lt2, e );
        if ( rs->sr_err != 0 ) {
+#ifdef NEW_LOGGING
+               LDAP_LOG ( OPERATION, ERR, 
+                       "<=- bdb_modrdn: id2entry failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#else
+               Debug(LDAP_DEBUG_TRACE,
+                       "<=- bdb_modrdn: id2entry failed: %s (%d)\n",
+                       db_strerror(rs->sr_err), rs->sr_err, 0 );
+#endif
                switch( rs->sr_err ) {
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED: