Log errors from dn2id failures

This commit is contained in:
Howard Chu 2003-04-30 07:47:24 +00:00
parent 35d18d4ab0
commit cfaf127eaa
2 changed files with 60 additions and 21 deletions

View 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 ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: dn2id failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
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;
}
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"<=- bdb_delete: dn2id failed %s (%d)\n", db_strerror(rs->sr_err), rs->sr_err, 0 );
#else
Debug(LDAP_DEBUG_ARGS,
"<=- bdb_delete: dn2id failed: %s (%d)\n",
db_strerror(rs->sr_err), rs->sr_err, 0 );
#endif
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;

View 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: