From ef239302ed8e190fe8cb5cee1a4791f7a9959980 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Mon, 13 May 2013 18:20:43 +0200 Subject: [PATCH] s3:dbwrap include the hashchain in the logs Signed-off-by: Christian Ambach Reviewed-by: Christof Schmitt Reviewed-by: Volker Lendecke --- source3/lib/dbwrap/dbwrap_ctdb.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c index 7bc1e476662..3db26900dc8 100644 --- a/source3/lib/dbwrap/dbwrap_ctdb.c +++ b/source3/lib/dbwrap/dbwrap_ctdb.c @@ -1163,12 +1163,21 @@ again: if ((migrate_attempts > lp_parm_int(-1, "ctdb", "migrate_attempts", 10)) || (duration_msecs > lp_parm_int(-1, "ctdb", "migrate_duration", 5000))) { - DEBUG(0, ("db_ctdb_fetch_locked for %s key %s needed %d " - "attempts, %d milliseconds, chainlock: %d ms, " - "CTDB %d ms\n", tdb_name(ctx->wtdb->tdb), + int chain = 0; + + if (tdb_get_flags(ctx->wtdb->tdb) & TDB_INCOMPATIBLE_HASH) { + chain = tdb_jenkins_hash(&key) % + tdb_hash_size(ctx->wtdb->tdb); + } + + DEBUG(0, ("db_ctdb_fetch_locked for %s key %s, chain %d " + "needed %d attempts, %d milliseconds, " + "chainlock: %d ms, CTDB %d ms\n", + tdb_name(ctx->wtdb->tdb), hex_encode_talloc(talloc_tos(), (unsigned char *)key.dptr, key.dsize), + chain, migrate_attempts, duration_msecs, (int) chainlock_time * 1000, (int) ctdb_time * 1000)); -- 2.11.4.GIT