Warning: interface change! Require versions >= 0

This commit is contained in:
2024-06-26 15:46:36 -07:00
parent 5f3833e965
commit b3aeed0caa
2 changed files with 4 additions and 6 deletions

View File

@@ -2236,9 +2236,7 @@ template <bool kBegin>
child->partialKeyLen = 0; child->partialKeyLen = 0;
child->parent = *self; child->parent = *self;
child->parentsIndex = key.front(); child->parentsIndex = key.front();
setMaxVersion(child, impl, setMaxVersion(child, impl, kBegin ? writeVersion : 0);
kBegin ? writeVersion
: std::numeric_limits<int64_t>::lowest());
} }
self = &child; self = &child;
@@ -2899,7 +2897,7 @@ Iterator firstGeq(Node *n, std::string_view key) {
[[maybe_unused]] int64_t checkMaxVersion(Node *root, Node *node, [[maybe_unused]] int64_t checkMaxVersion(Node *root, Node *node,
int64_t oldestVersion, bool &success, int64_t oldestVersion, bool &success,
ConflictSet::Impl *impl) { ConflictSet::Impl *impl) {
int64_t expected = std::numeric_limits<int64_t>::lowest(); int64_t expected = 0;
if (node->entryPresent) { if (node->entryPresent) {
expected = std::max(expected, node->entry.pointVersion); expected = std::max(expected, node->entry.pointVersion);
} }

View File

@@ -21,7 +21,7 @@ limitations under the License.
#ifdef __cplusplus #ifdef __cplusplus
namespace weaselab { namespace weaselab {
/** A data structure for optimistic concurrency control on ranges of /** A data structure for optimistic concurrency control on ranges of
* bitwise-lexicographically-ordered keys. * bitwise-lexicographically-ordered keys. All versions must be >= 0.
* *
* Thread safety: * Thread safety:
* - It's safe to operate on two different ConflictSets in two different * - It's safe to operate on two different ConflictSets in two different
@@ -106,7 +106,7 @@ private:
#else #else
/** A data structure for optimistic concurrency control on ranges of /** A data structure for optimistic concurrency control on ranges of
* bitwise-lexicographically-ordered keys. * bitwise-lexicographically-ordered keys. All versions must be >= 0.
* *
* Thread safety: * Thread safety:
* - It's safe to operate on two different ConflictSets in two different * - It's safe to operate on two different ConflictSets in two different