Fix gc-too-slow issue

Previously, with a finite set of keys, latest_extant_version could fall all the way behind so that a call to addWrites would have to do O(n) work eventually.
This commit is contained in:
andrew committed 2024-10-27 21:13:27 -07:00
1 parent e5452c0f7d
commit e025f934d8
1 file changed
+3
+3
View File
@@ -4412,6 +4412,9 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
assert(writeContext.accum.entries_erased == 0);
assert(writeContext.accum.entries_inserted == 0);
// Queue up some gc work just for (potentially) increasing the version
++keyUpdates;
if (oldestExtantVersion < writeVersion - kMaxCorrectVersionWindow)
[[unlikely]] {
if (writeVersion > newestVersionFullPrecision + kNominalVersionWindow) {