Update maxVersion to max(maxVersion, writeVersion)

This commit is contained in:
2024-01-26 10:25:32 -08:00
parent 270f887584
commit b8de633ca1

View File

@@ -1151,7 +1151,7 @@ Iterator lastLeq(Node *n, const std::span<const uint8_t> key) {
void insert(Node **self_, std::span<const uint8_t> key, int64_t writeVersion) {
for (;;) {
auto &self = *self_;
self->maxVersion = writeVersion;
self->maxVersion = std::max(self->maxVersion, writeVersion);
if (key.size() == 0) {
auto l = lastLeq(self, key);
self->entryPresent = true;