s3:dbwrap include the hashchain in the logs
authorChristian Ambach <ambi@samba.org>
Mon, 13 May 2013 16:20:43 +0000 (18:20 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 16 Jan 2014 08:18:45 +0000 (09:18 +0100)
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/lib/dbwrap/dbwrap_ctdb.c

index 7bc1e4766623666537aad51d85de0bfdf887d35c..3db26900dc8a9bdbf1409d3875cd44f6e1bf0037 100644 (file)
@@ -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));