Summary
Support in-place value updates instead of rejecting duplicate inserts.
Motivation
Currently, inserting a key that already exists returns DuplicateKey error. For some use cases, you may want to update the value in place without creating a new node.
Current Behavior
sl.insert(b"key", b"value1");
sl.insert(b"key", b"value2"); // Returns false, DuplicateKey error
Desired Behavior
sl.insert(b"key", b"value1");
sl.update(b"key", b"value2"); // Updates value in place, returns old value
Or alternatively, make insert have an update mode:
sl.insert(b"key", b"value1");
sl.insert(b"key", b"value2", UpdateMode::Overwrite); // Updates value
Implementation Notes
The design doc mentions "update value (or insert tombstone version for MVCC)" but we went with MVCC approach (seal + fresh memtable). An in-place update could be added as an alternative.
From design doc
See LOCKFREE_SKIPLIST_DESIGN.md lines 191-192
Priority: low
Summary
Support in-place value updates instead of rejecting duplicate inserts.
Motivation
Currently, inserting a key that already exists returns
DuplicateKeyerror. For some use cases, you may want to update the value in place without creating a new node.Current Behavior
Desired Behavior
Or alternatively, make
inserthave an update mode:Implementation Notes
The design doc mentions "update value (or insert tombstone version for MVCC)" but we went with MVCC approach (seal + fresh memtable). An in-place update could be added as an alternative.
From design doc
See LOCKFREE_SKIPLIST_DESIGN.md lines 191-192
Priority: low