From 1b2fc1f096f80db5974eab021f12f0ad9af24882 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 14 Feb 2014 22:02:41 +0100 Subject: [PATCH] ctdb-vacuum: add consistency check for counts at end of process_delete_list() Signed-off-by: Michael Adam Reviewed-by: Amitay Isaacs --- ctdb/server/ctdb_vacuum.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index e69452294e8..100377ee8ad 100644 --- a/ctdb/server/ctdb_vacuum.c +++ b/ctdb/server/ctdb_vacuum.c @@ -849,6 +849,7 @@ static int ctdb_process_delete_list(struct ctdb_db_context *ctdb_db, uint32_t *active_nodes; int num_active_nodes; TALLOC_CTX *tmp_ctx; + uint32_t sum; if (vdata->delete_count == 0) { return 0; @@ -1114,6 +1115,19 @@ success: (unsigned)vdata->delete_left)); } + sum = vdata->delete_deleted + + vdata->delete_skipped + + vdata->delete_remote_error + + vdata->delete_local_error + + vdata->delete_left; + + if (vdata->delete_count != sum) { + DEBUG(DEBUG_ERR, (__location__ " Inconsistency in vacuum " + "delete list counts for db[%s]: total[%u] != sum[%u]\n", + ctdb_db->db_name, (unsigned)vdata->delete_count, + (unsigned)sum)); + } + if (vdata->delete_count > 0) { DEBUG(DEBUG_INFO, (__location__ -- 2.11.4.GIT