diff --git a/ConflictSet.cpp b/ConflictSet.cpp index abfe6d2..600fe4a 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -3070,8 +3070,12 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl { rootMaxVersion = std::max(rootMaxVersion, oldestVersion); n = nextPhysical(n); } - for (; fuel > 0 && n != nullptr; --fuel) { + for (; fuel > 0 && n != nullptr;) { rezero(n, oldestVersion); + // The "make sure gc keeps up with writes" calculations assume that we're + // scanning key by key, not node by node. Make sure we only spend fuel + // when there's a logical entry. + fuel -= n->entryPresent; if (n->entryPresent && std::max(n->entry.pointVersion, n->entry.rangeVersion) <= oldestVersion) { // Any transaction n would have prevented from committing is