Fix an issue where gc wasn't outpacing writes

This commit is contained in:
2024-07-11 16:40:18 -07:00
parent bd8ed4e7bd
commit 4182d904c5
+5 -1
View File
@@ -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