From 48f6a47c1edb22f923fe1eba6cc0d42348bcd24e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 20 Oct 2012 09:25:14 -0700 Subject: [PATCH] ITS#7402 add txnID to debug output to aid tracing --- servers/slapd/back-bdb/add.c | 4 ++++ servers/slapd/back-bdb/config.c | 2 ++ servers/slapd/back-bdb/delete.c | 4 ++++ servers/slapd/back-bdb/modify.c | 4 ++++ servers/slapd/back-bdb/modrdn.c | 4 ++++ servers/slapd/back-bdb/tools.c | 6 ++++++ 6 files changed, 24 insertions(+) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index f9055b9bb0..89d6e4967e 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -159,6 +159,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_add) ": txn1 id: %u\n", + ltid->id(ltid), 0, 0 ); opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; @@ -376,6 +378,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_add) ": txn2 id: %u\n", + lt2->id(lt2), 0, 0 ); /* dn2id index */ rs->sr_err = bdb_dn2id_add( op, lt2, ei, op->ora_e ); diff --git a/servers/slapd/back-bdb/config.c b/servers/slapd/back-bdb/config.c index 85569f3694..d12e5d8091 100644 --- a/servers/slapd/back-bdb/config.c +++ b/servers/slapd/back-bdb/config.c @@ -241,6 +241,8 @@ bdb_online_index( void *ctx, void *arg ) rc = TXN_BEGIN( bdb->bi_dbenv, NULL, &txn, bdb->bi_db_opflags ); if ( rc ) break; + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_online_index) ": txn id: %u\n", + txn->id(txn), 0, 0 ); if ( getnext ) { getnext = 0; BDB_ID2DISK( id, &nid ); diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 9b9b3e63db..017ba960d0 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -143,6 +143,8 @@ retry: /* transaction retry */ /* begin transaction */ rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, NULL, <id, bdb->bi_db_opflags ); + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_delete) ": txn1 id: %u\n", + ltid->id(ltid), 0, 0 ); rs->sr_text = NULL; if( rs->sr_err != 0 ) { Debug( LDAP_DEBUG_TRACE, @@ -368,6 +370,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_delete) ": txn2 id: %u\n", + lt2->id(lt2), 0, 0 ); BDB_LOG_PRINTF( bdb->bi_dbenv, lt2, "slapd Starting delete %s(%d)", e->e_nname.bv_val, e->e_id ); diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 734cdec3be..6b8c6ba6be 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -514,6 +514,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_modify) ": txn1 id: %u\n", + ltid->id(ltid), 0, 0 ); opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; @@ -633,6 +635,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_modify) ": txn2 id: %u\n", + lt2->id(lt2), 0, 0 ); /* Modify the entry */ dummy = *e; rs->sr_err = bdb_modify_internal( op, lt2, op->orm_modlist, diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 1d7e4a717c..c0dd650df9 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -162,6 +162,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_modrdn) ": txn1 id: %u\n", + ltid->id(ltid), 0, 0 ); opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; @@ -601,6 +603,8 @@ retry: /* transaction retry */ rs->sr_text = "internal error"; goto return_results; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_modrdn) ": txn2 id: %u\n", + lt2->id(lt2), 0, 0 ); /* delete old DN */ rs->sr_err = bdb_dn2id_delete( op, lt2, eip, e ); diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 40d46461dd..88b561d9b7 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -672,6 +672,8 @@ ID bdb_tool_entry_put( text->bv_val, 0, 0 ); return NOID; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_tool_entry_put) ": txn id: %u\n", + tid->id(tid), 0, 0 ); } op.o_hdr = &ohdr; @@ -839,6 +841,8 @@ int bdb_tool_entry_reindex( db_strerror(rc), rc, 0 ); goto done; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_tool_entry_reindex) ": txn id: %u\n", + tid->id(tid), 0, 0 ); } /* @@ -929,6 +933,8 @@ ID bdb_tool_entry_modify( text->bv_val, 0, 0 ); return NOID; } + Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_tool_entry_modify) ": txn id: %u\n", + tid->id(tid), 0, 0 ); } op.o_hdr = &ohdr; -- 2.39.5