Commit 1123e379 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

More explicit logging if mdb_txn_commit fails

Change LDAP_DEBUG_TRACE to LDAP_DEBUG_ANY.
Add log msg if it wasn't being logged before.
parent 177ec8d8
......@@ -411,7 +411,7 @@ txnReturn:
txn = NULL;
if ( rs->sr_err != 0 ) {
rs->sr_text = "txn_commit failed";
Debug( LDAP_DEBUG_TRACE,
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_add) ": %s : %s (%d)\n",
rs->sr_text, mdb_strerror(rs->sr_err), rs->sr_err );
rs->sr_err = LDAP_OTHER;
......
......@@ -194,8 +194,13 @@ mdb_online_index( void *ctx, void *arg )
mdb_txn_abort( txn );
txn = NULL;
}
if ( rc )
if ( rc ) {
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_online_index) ": database %s: "
"txn_commit failed: %s (%d)\n",
be->be_suffix[0].bv_val, mdb_strerror(rc), rc );
break;
}
id++;
getnext = 1;
}
......
......@@ -418,7 +418,7 @@ txnReturn:
}
if( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_delete) ": txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
mdb_strerror(rs->sr_err), rs->sr_err );
......
......@@ -242,6 +242,10 @@ mdb_db_open( BackendDB *be, ConfigReply *cr )
rc = mdb_txn_commit(txn);
if ( rc != 0 ) {
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_db_open) ": database %s: "
"txn_commit failed: %s (%d)\n",
be->be_suffix[0].bv_val, mdb_strerror(rc), rc );
goto fail;
}
......
......@@ -629,7 +629,7 @@ txnReturn:
}
if( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_modify) ": txn_%s failed: %s (%d)\n",
op->o_noop ? "abort (no-op)" : "commit",
mdb_strerror(rs->sr_err), rs->sr_err );
......
......@@ -594,7 +594,7 @@ txnReturn:
}
if( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_modrdn) ": %s : %s (%d)\n",
rs->sr_text, mdb_strerror(rs->sr_err), rs->sr_err );
rs->sr_err = LDAP_OTHER;
......
......@@ -165,9 +165,15 @@ int mdb_tool_entry_close(
cursor = NULL;
}
if( txn ) {
int rc;
MDB_TOOL_IDL_FLUSH( be, txn );
if ( mdb_txn_commit( txn ))
if (( rc = mdb_txn_commit( txn ))) {
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(mdb_tool_entry_close) ": database %s: "
"txn_commit failed: %s (%d)\n",
be->be_suffix[0].bv_val, mdb_strerror(rc), rc );
return -1;
}
txn = NULL;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment