vacuum: improve debugging in delete_queue_traverse()
authorMichael Adam <obnox@samba.org>
Fri, 23 Dec 2011 16:08:28 +0000 (17:08 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 12 Jan 2012 07:50:40 +0000 (08:50 +0100)
(cherry picked from commit 2c44c6dc583872c603a399afb01936abcbb05158)

server/ctdb_vacuum.c

index 92df9b7ab0fcbf5f782580dfb744448b3847d3ec..8d4a9f8dd5f4d42bf04884531eb1e585e873c858 100644 (file)
@@ -333,12 +333,16 @@ static int delete_queue_traverse(void *param, void *data)
        struct ctdb_ltdb_header *header;
        TDB_DATA tdb_data;
        uint32_t lmaster;
+       uint32_t hash = ctdb_hash(&(dd->key));
 
        vdata->fast_total++;
 
        res = tdb_chainlock(ctdb_db->ltdb->tdb, dd->key);
        if (res != 0) {
-               DEBUG(DEBUG_ERR, (__location__ " Error getting chainlock.\n"));
+               DEBUG(DEBUG_ERR,
+                     (__location__ " Error getting chainlock on record with "
+                      "key hash [0x%08x] on database db[%s].\n",
+                      hash, ctdb_db->db_name));
                vdata->fast_error++;
                return 0;
        }
@@ -361,7 +365,6 @@ static int delete_queue_traverse(void *param, void *data)
                goto skipped;
        }
 
-
        if (header->rsn != dd->hdr.rsn) {
                /*
                 * The record has been migrated off the node and back again.
@@ -412,10 +415,15 @@ static int delete_queue_traverse(void *param, void *data)
 
                if (res != 0) {
                        DEBUG(DEBUG_ERR,
-                             (__location__ " Error deleting record from local "
-                              "data base.\n"));
+                             (__location__ " Error deleting record with key "
+                              "hash [0x%08x] from local data base db[%s].\n",
+                              hash, ctdb_db->db_name));
                        vdata->fast_error++;
                } else {
+                       DEBUG(DEBUG_DEBUG,
+                             (__location__ " Deleted record with key hash "
+                              "[0x%08x] from local data base db[%s].\n",
+                              hash, ctdb_db->db_name));
                        vdata->fast_deleted++;
                }
        }