summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_call.c
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2017-02-16 16:23:39 -0700
committerChristof Schmitt <cs@samba.org>2017-05-08 21:08:23 +0200
commit10b36782bf61fd30e4693244c7b698895ad09c2d (patch)
treebee29d7685f878080d036a096e72f0c33e4b9aae /ctdb/server/ctdb_call.c
parentee3b17ba4674a17a411c9ec4271e087c8cd7dad1 (diff)
downloadsamba-10b36782bf61fd30e4693244c7b698895ad09c2d.tar.gz
ctdb: Print key as hex string instead of just the hash in hot record message
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r--ctdb/server/ctdb_call.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c
index ed943f91b3c..3b84e754008 100644
--- a/ctdb/server/ctdb_call.c
+++ b/ctdb/server/ctdb_call.c
@@ -825,6 +825,7 @@ ctdb_update_db_stat_hot_keys(struct ctdb_db_context *ctdb_db, TDB_DATA key,
int count)
{
int i, id;
+ char *keystr;
/* smallest value is always at index 0 */
if (count <= ctdb_db->statistics.hot_keys[0].count) {
@@ -860,9 +861,13 @@ ctdb_update_db_stat_hot_keys(struct ctdb_db_context *ctdb_db, TDB_DATA key,
ctdb_db->statistics.hot_keys[id].key.dsize = key.dsize;
ctdb_db->statistics.hot_keys[id].key.dptr = talloc_memdup(ctdb_db, key.dptr, key.dsize);
ctdb_db->statistics.hot_keys[id].count = count;
- DEBUG(DEBUG_NOTICE,
- ("Updated hot key database=%s key=0x%08x id=%d count=%d\n",
- ctdb_db->db_name, ctdb_hash(&key), id, count));
+
+ keystr = hex_encode_talloc(ctdb_db,
+ (unsigned char *)key.dptr, key.dsize);
+ DEBUG(DEBUG_NOTICE,("Updated hot key database=%s key=%s id=%d "
+ "count=%d\n", ctdb_db->db_name,
+ keystr ? keystr : "" , id, count));
+ talloc_free(keystr);
sort_keys:
for (i = 1; i < MAX_HOT_KEYS; i++) {