From: Howard Chu Date: Wed, 30 Apr 2003 07:47:24 +0000 (+0000) Subject: Log errors from dn2id failures X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~199 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cfaf127eaa88f42e8757898922e4d139bfa2d12f;p=openldap Log errors from dn2id failures --- diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 2d5302e64c..ad44e858ac 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -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; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index f7343ccf6e..59cf33efcf 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -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: