summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-12-23 17:23:07 +0100
committerMichael Adam <obnox@samba.org>2011-12-23 17:39:13 +0100
commitbf99bb65e0327d53ccc095153d695f20c34beabc (patch)
tree1cfb07d345d8be301b9f5dc2cd3a861231f0a501
parentca7d2bf63a9f56adc105b5e3218864bedb54b7aa (diff)
downloadsamba-bf99bb65e0327d53ccc095153d695f20c34beabc.tar.gz
samba-bf99bb65e0327d53ccc095153d695f20c34beabc.tar.xz
samba-bf99bb65e0327d53ccc095153d695f20c34beabc.zip
vacuum: improve logging in remove_record_from_delete_queue()
(This used to be ctdb commit 809d1f3b8a9232fce0376cb47e4f633b49237529)
-rw-r--r--ctdb/server/ctdb_vacuum.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c
index 397a55ce91..ff373564f8 100644
--- a/ctdb/server/ctdb_vacuum.c
+++ b/ctdb/server/ctdb_vacuum.c
@@ -1418,7 +1418,8 @@ static void remove_record_from_delete_queue(struct ctdb_db_context *ctdb_db,
hash = (uint32_t)ctdb_hash(&key);
DEBUG(DEBUG_DEBUG, (__location__
- " remove_record_from_delete_queue: db[%s] "
+ " remove_record_from_delete_queue: "
+ "db[%s] "
"db_id[0x%08x] "
"key_hash[0x%08x] "
"lmaster[%u] "
@@ -1430,15 +1431,29 @@ static void remove_record_from_delete_queue(struct ctdb_db_context *ctdb_db,
kd = (struct delete_record_data *)trbt_lookup32(ctdb_db->delete_queue, hash);
if (kd == NULL) {
+ DEBUG(DEBUG_DEBUG, (__location__
+ " remove_record_from_delete_queue: "
+ "record not in queue (hash[0x%08x])\n.",
+ hash));
return;
}
- if (kd->key.dsize != key.dsize) {
- return;
- }
- if (memcmp(kd->key.dptr, key.dptr, key.dsize) != 0) {
+
+ if ((kd->key.dsize != key.dsize) ||
+ (memcmp(kd->key.dptr, key.dptr, key.dsize) != 0))
+ {
+ DEBUG(DEBUG_DEBUG, (__location__
+ " remove_record_from_delete_queue: "
+ "hash collision for key with hash[0x%08x] "
+ "in db[%s] - skipping\n",
+ hash, ctdb_db->db_name));
return;
}
+ DEBUG(DEBUG_DEBUG, (__location__
+ " remove_record_from_delete_queue: "
+ "removing key with hash[0x%08x]\n",
+ hash));
+
talloc_free(kd);
return;