s3:dbwrap_ctdb: Add DB name and key to warning message
authorChristof Schmitt <christof.schmitt@us.ibm.com>
Thu, 30 Aug 2012 20:16:24 +0000 (13:16 -0700)
committerChristian Ambach <ambi@samba.org>
Fri, 31 Aug 2012 09:10:14 +0000 (11:10 +0200)
When a operation takes too long, it is useful for debugging to know the
DB and the key.

Signed-off-by: Christian Ambach <ambi@samba.org>
source3/lib/dbwrap/dbwrap_ctdb.c

index 0a579974e85b05d67961a0f6d12d56c9cfe40535..6d46586896b630a82fcdaa053a6073bc90d301ea 100644 (file)
@@ -996,7 +996,14 @@ static int db_ctdb_record_destr(struct db_record* data)
        if (threshold != 0) {
                double timediff = timeval_elapsed(&crec->lock_time);
                if ((timediff * 1000) > threshold) {
-                       DEBUG(0, ("Held tdb lock %f seconds\n", timediff));
+                       const char *key;
+
+                       key = hex_encode_talloc(data,
+                                               (unsigned char *)data->key.dptr,
+                                               data->key.dsize);
+                       DEBUG(0, ("Held tdb lock on db %s, key %s %f seconds\n",
+                                 tdb_name(crec->ctdb_ctx->wtdb->tdb), key,
+                                 timediff));
                }
        }