From 14c066e46b01d970e33408d65b46d507a77bb8df Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 25 Aug 2014 03:24:11 +1000 Subject: [PATCH] ckdb - confirm: add workinfoid and date ranges of problems --- src/ckdb.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/ckdb.c b/src/ckdb.c index 63d5132f..39cf29e0 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -47,7 +47,7 @@ #define DB_VLOCK "1" #define DB_VERSION "0.7" -#define CKDB_VERSION DB_VERSION"-0.50" +#define CKDB_VERSION DB_VERSION"-0.51" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ @@ -9138,6 +9138,11 @@ static void compare_summaries(K_TREE *leftsum, char *leftname, SHARESUMMARY sharesummary; uint64_t total, ok, missing, diff; uint64_t first_used = 0, last_used = 0; + int64_t miss_first = 0, miss_last = 0; + tv_t miss_first_cd = {0,0}, miss_last_cd = {0,0}; + int64_t diff_first = 0, diff_last = 0; + tv_t diff_first_cd = {0,0}, diff_last_cd = {0,0}; + char cd_buf1[DATE_BUFSIZ], cd_buf2[DATE_BUFSIZ]; sharesummary.workinfoid = confirm_first_workinfoid; sharesummary.userid = -1; @@ -9159,6 +9164,12 @@ static void compare_summaries(K_TREE *leftsum, char *leftname, rss = find_in_ktree(rightsum, lss, cmp_sharesummary_workinfoid, ctxr); if (!rss) { missing++; + if (miss_first == 0) { + miss_first = DATA_SHARESUMMARY(lss)->workinfoid; + copy_tv(&miss_first_cd, &(DATA_SHARESUMMARY(lss)->createdate)); + } + miss_last = DATA_SHARESUMMARY(lss)->workinfoid; + copy_tv(&miss_last_cd, &(DATA_SHARESUMMARY(lss)->createdate)); if (show_missing) { LOGERR("ERROR: %s %"PRId64"/%s/%ld,%ld %.19s missing from %s", leftname, @@ -9171,6 +9182,12 @@ static void compare_summaries(K_TREE *leftsum, char *leftname, } } else if (DATA_SHARESUMMARY(rss)->diffacc != DATA_SHARESUMMARY(lss)->diffacc) { diff++; + if (diff_first == 0) { + diff_first = DATA_SHARESUMMARY(lss)->workinfoid; + copy_tv(&diff_first_cd, &(DATA_SHARESUMMARY(lss)->createdate)); + } + diff_last = DATA_SHARESUMMARY(lss)->workinfoid; + copy_tv(&diff_last_cd, &(DATA_SHARESUMMARY(lss)->createdate)); if (show_diff) { LOGERR("ERROR: %"PRId64"/%s/%ld,%ld %.19s - diffacc: %s: %.0f %s: %.0f", DATA_SHARESUMMARY(lss)->workinfoid, @@ -9193,6 +9210,20 @@ static void compare_summaries(K_TREE *leftsum, char *leftname, " missing: %"PRIu64" different: %"PRIu64, leftname, rightname, total, first_used, last_used, missing, diff); + if (miss_first) { + tv_to_buf(&miss_first_cd, cd_buf1, sizeof(cd_buf1)); + tv_to_buf(&miss_last_cd, cd_buf2, sizeof(cd_buf2)); + LOGERR(" workinfoid range for missing: %"PRId64"-%"PRId64 + " (%s .. %s)", + miss_first, miss_last, cd_buf1, cd_buf2); + } + if (diff_first) { + tv_to_buf(&diff_first_cd, cd_buf1, sizeof(cd_buf1)); + tv_to_buf(&diff_last_cd, cd_buf2, sizeof(cd_buf2)); + LOGERR(" workinfoid range for differences: %"PRId64"-%"PRId64 + " (%s .. %s)", + diff_first, diff_last, cd_buf1, cd_buf2); + } } static void confirm_reload()