vacuum: add DEBUG to skip conditions in delete_record_traverse()
authorMichael Adam <obnox@samba.org>
Wed, 3 Apr 2013 12:12:27 +0000 (14:12 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 26 Apr 2013 14:04:59 +0000 (16:04 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 817c77a3d0a3546bf46389cec5f6b54778dd1693)

Conflicts:

server/ctdb_vacuum.c

server/ctdb_vacuum.c

index 89e261ac127f290f0f3665123df8ddb6bf0cc31f..a3775cc558b8b867fd2ab95a38c479f4e26c2be3 100644 (file)
@@ -480,13 +480,19 @@ static int delete_record_traverse(void *param, void *data)
 
        tdb_data = tdb_fetch(ctdb_db->ltdb->tdb, dd->key);
        if (tdb_data.dsize < sizeof(struct ctdb_ltdb_header)) {
-               /* Does not exist or not a ctdb record. Skip. */
+               DEBUG(DEBUG_INFO, (__location__ ": record with hash [0x%08x] "
+                                  "on database db[%s] does not exist or is not"
+                                  " a ctdb-record.  skipping.\n",
+                                  hash, ctdb_db->db_name));
                vdata->delete_skipped++;
                goto done;
        }
 
        if (tdb_data.dsize > sizeof(struct ctdb_ltdb_header)) {
-               /* The record has been recycled (filled with data). Skip. */
+               DEBUG(DEBUG_INFO, (__location__ ": record with hash [0x%08x] "
+                                  "on database db[%s] has been recycled. "
+                                  "skipping.\n",
+                                  hash, ctdb_db->db_name));
                vdata->delete_skipped++;
                goto done;
        }
@@ -494,7 +500,10 @@ static int delete_record_traverse(void *param, void *data)
        header = (struct ctdb_ltdb_header *)tdb_data.dptr;
 
        if (header->dmaster != ctdb->pnn) {
-               /* The record has been migrated off the node. Skip. */
+               DEBUG(DEBUG_INFO, (__location__ ": record with hash [0x%08x] "
+                                  "on database db[%s] has been migrated away. "
+                                  "skipping.\n",
+                                  hash, ctdb_db->db_name));
                vdata->delete_skipped++;
                goto done;
        }
@@ -505,6 +514,11 @@ static int delete_record_traverse(void *param, void *data)
                 * The record has been migrated off the node and back again.
                 * But not requeued for deletion. Skip it.
                 */
+               DEBUG(DEBUG_INFO, (__location__ ": record with hash [0x%08x] "
+                                  "on database db[%s] seems to have been "
+                                  "migrated away and back again (with empty "
+                                  "data). skipping.\n",
+                                  hash, ctdb_db->db_name));
                vdata->delete_skipped++;
                goto done;
        }
@@ -512,7 +526,10 @@ static int delete_record_traverse(void *param, void *data)
        lmaster = ctdb_lmaster(ctdb_db->ctdb, &dd->key);
 
        if (lmaster != ctdb->pnn) {
-               /* we are not lmaster - strange */
+               DEBUG(DEBUG_INFO, (__location__ ": not lmaster for record in "
+                                  "delete list (key hash [0x%08x], db[%s]). "
+                                  "Strange! skipping.\n",
+                                  hash, ctdb_db->db_name));
                vdata->delete_skipped++;
                goto done;
        }