Bug fix in tree clear and size check where sometimes there could still be old versions of pages in use because not enough commits have passed for them to be rolled off and freed.

This commit is contained in:
Stephen Atherton 2019-11-04 11:12:26 -08:00
parent 4e9c3164a8
commit 0c95fef8aa
1 changed files with 4 additions and 3 deletions

View File

@ -2812,6 +2812,7 @@ public:
}
}
debug_printf("LazyDelete: freed %d pages, %s has %" PRId64 " entries\n", freedPages, self->m_lazyDeleteQueue.name.c_str(), self->m_lazyDeleteQueue.numEntries);
return freedPages;
}
@ -2923,10 +2924,10 @@ public:
self->clear(KeyRangeRef(dbBegin.key, dbEnd.key));
loop {
int freedPages = wait(self->incrementalSubtreeClear(self));
debug_printf("incrementalSubtreeClear freed %d\n", freedPages);
state int freedPages = wait(self->incrementalSubtreeClear(self));
wait(self->commit());
if(self->m_lazyDeleteQueue.numEntries == 0) {
// Keep looping until the last commit doesn't do anything at all
if(self->m_lazyDeleteQueue.numEntries == 0 && freedPages == 0) {
break;
}
self->setWriteVersion(self->getLatestVersion() + 1);