From 641682f57e007156dfc81fbe5b3b54774a3c976c Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 16 Jun 2017 14:23:10 +1000 Subject: [PATCH] Count workbases as incomplete even if they're currently in use. --- src/stratifier.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 2727e9b1..972da8e6 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1676,17 +1676,21 @@ static void check_incomplete_wbs(ckpool_t *ckp, sdata_t *sdata) ck_wlock(&sdata->workbase_lock); HASH_ITER(hh, sdata->remote_workbases, wb, tmp) { - if (!wb->incomplete || wb->readcount) + if (!wb->incomplete) + continue; + incomplete++; + /* We can't remove a workbase that is currently in use */ + if (wb->readcount) continue; /* Remove the workbase from the hashlist so we can work on it * without holding the lock */ HASH_DEL(sdata->remote_workbases, wb); ck_wunlock(&sdata->workbase_lock); - if (rebuild_txns(ckp, sdata, wb)) + if (rebuild_txns(ckp, sdata, wb)) { LOGNOTICE("Rebuilt transactions on previously failed remote workinfo"); - else - incomplete++; + incomplete--; + } /* Add it to a list of removed workbases, to be returned once * we exit this HASH_ITER loop. */