diff options
Diffstat (limited to 'ldap/servers/slapd/back-ldbm/ldbm_delete.c')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/ldbm_delete.c | 53 |
1 files changed, 37 insertions, 16 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c index 97873003..82241146 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c @@ -45,6 +45,12 @@ #include "back-ldbm.h" +#define DEL_SET_ERROR(rc, error, count) \ +{ \ + (rc) = (error); \ + (count) = RETRY_TIMES; /* otherwise, the transaction may not be aborted */ \ +} + int ldbm_back_delete( Slapi_PBlock *pb ) { @@ -445,7 +451,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) LDAPDebug( LDAP_DEBUG_ANY, "id2entry_add failed, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } if (cache_add_tentative( &inst->inst_cache, tombstone, NULL) == 0) { @@ -467,7 +474,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) LDBM_OS_ERR_IS_DISKFULL(retval)) { disk_full = 1; } - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -486,7 +494,7 @@ ldbm_back_delete( Slapi_PBlock *pb ) } if (retval != 0) { LDAPDebug( LDAP_DEBUG_TRACE, "index_del_entry failed\n", 0, 0, 0 ); - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } if(create_tombstone_entry) @@ -512,7 +520,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_VALUE_TOMBSTONE, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } retval = index_addordel_string(be, SLAPI_ATTR_UNIQUEID, @@ -531,7 +540,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_UNIQUEID, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } retval = index_addordel_string(be, SLAPI_ATTR_NSCP_ENTRYDN, @@ -550,7 +560,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_NSCP_ENTRYDN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } /* add a new usn to the entryusn index */ @@ -573,7 +584,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_ENTRYUSN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -596,7 +608,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_ENTRYUSN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -616,7 +629,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -645,7 +659,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_VALUE_TOMBSTONE, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } retval = index_addordel_string(be, SLAPI_ATTR_UNIQUEID, @@ -664,7 +679,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_UNIQUEID, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } @@ -687,7 +703,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_NSCP_ENTRYDN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -712,7 +729,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) SLAPI_ATTR_ENTRYUSN, retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -732,7 +750,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) retval, (msg = dblayer_strerror( retval )) ? msg : "" ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -751,7 +770,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) LDAPDebug( LDAP_DEBUG_TRACE, "delete 3 BAD, err=%d %s\n", retval, (msg = dblayer_strerror( retval )) ? msg : "", 0 ); if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } @@ -771,7 +791,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) } if (retval != 0 ) { if (LDBM_OS_ERR_IS_DISKFULL(retval)) disk_full = 1; - ldap_result_code= LDAP_OPERATIONS_ERROR; + DEL_SET_ERROR(ldap_result_code, + LDAP_OPERATIONS_ERROR, retry_count); goto error_return; } } |