]> git.sur5r.net Git - openldap/commitdiff
More explicit logging if mdb_txn_commit fails
authorHoward Chu <hyc@openldap.org>
Sat, 2 Feb 2013 13:31:39 +0000 (05:31 -0800)
committerHoward Chu <hyc@openldap.org>
Sat, 2 Feb 2013 13:31:39 +0000 (05:31 -0800)
Change LDAP_DEBUG_TRACE to LDAP_DEBUG_ANY.
Add log msg if it wasn't being logged before.

servers/slapd/back-mdb/add.c
servers/slapd/back-mdb/config.c
servers/slapd/back-mdb/delete.c
servers/slapd/back-mdb/init.c
servers/slapd/back-mdb/modify.c
servers/slapd/back-mdb/modrdn.c
servers/slapd/back-mdb/tools.c

index 02084247fe8ffbd7963c11b282fea746d418d544..332d5c6b210c9f87b83919d299471e62b2604804 100644 (file)
@@ -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;
index 5d9383e00afcce955b0343789b87c93d212a018f..fa11d8c1f3313be930a244edeab4694e55b2a8ed 100644 (file)
@@ -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;
        }
index c1e9494966fe7dd4cca7a9e347fad9f7231453f0..1735fee799c35d4d34e10aca6bda02c1fa3fb947 100644 (file)
@@ -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 );
index 82a6d70ae57079fc84832c26b45fd4767797f48a..8833de40896ba2eb3b90821a06559152f442d879 100644 (file)
@@ -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;
        }
 
index 06393d0bdd347dc2f597b58f4516fbe2c6a69f40..1ea664f4fe9ef5e9c2c3be77b7c2e39261cc0f46 100644 (file)
@@ -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 );
index aa8a085384cae17790d8192a877ec97745a35827..de3a219721d181c318b437b07237ef5885595626 100644 (file)
@@ -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;
index 3747c7ad079355cc75a73358f75b42fc212b1311..2ef6091dad14af9d5ca225ceeb611b00d5c772ec 100644 (file)
@@ -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;
        }