s3:dbwrap include the hashchain in the logs
authorChristian Ambach <ambi@samba.org>
Mon, 13 May 2013 16:20:43 +0000 (18:20 +0200)
committerChristian Ambach <ambi@samba.org>
Tue, 14 May 2013 13:55:03 +0000 (15:55 +0200)
Signed-off-by: Christian Ambach <ambi@samba.org>
source3/lib/dbwrap/dbwrap_ctdb.c

index a02c88ac57f2cc461cbdf16781589cb7cba137c3..7c1a50615f793e1cc258fbe0e942f3ceb14f37f5 100644 (file)
@@ -1129,12 +1129,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));