ctdb-vacuum: fix possible cause for delelete_list processing counts left records > 0
authorMichael Adam <obnox@samba.org>
Wed, 19 Feb 2014 23:58:17 +0000 (00:58 +0100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 6 Mar 2014 00:31:16 +0000 (11:31 +1100)
We need to have left records == 0 at the end of the delete list processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_vacuum.c

index 56bfe96edca3bd534d8949e058bd0e6635e135be..b5424dccf034b1b53af17bbafb067089f87a7b9e 100644 (file)
@@ -976,6 +976,14 @@ static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
                                talloc_free(dd);
                                vdata->count.delete_list.remote_error++;
                                vdata->count.delete_list.left--;
+                       } else {
+                               DEBUG(DEBUG_ERR, (__location__ " Failed to "
+                                     "find record with hash 0x%08x coming "
+                                     "back from RECEIVE_RECORDS "
+                                     "control in delete list.\n",
+                                     ctdb_hash(&reckey)));
+                               vdata->count.delete_list.local_error++;
+                               vdata->count.delete_list.left--;
                        }
 
                        rec = (struct ctdb_rec_data *)(rec->length + (uint8_t *)rec);
@@ -1075,6 +1083,14 @@ static void ctdb_process_delete_list(struct ctdb_db_context *ctdb_db,
                                talloc_free(dd);
                                vdata->count.delete_list.remote_error++;
                                vdata->count.delete_list.left--;
+                       } else {
+                               DEBUG(DEBUG_ERR, (__location__ " Failed to "
+                                     "find record with hash 0x%08x coming "
+                                     "back from TRY_DELETE_RECORDS "
+                                     "control in delete list.\n",
+                                     ctdb_hash(&reckey)));
+                               vdata->count.delete_list.local_error++;
+                               vdata->count.delete_list.left--;
                        }
 
                        rec = (struct ctdb_rec_data *)(rec->length + (uint8_t *)rec);