You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[lsm] get() on a non-unique index resurrects deleted RIDs when tombstone and entry are in different pages #4945
Both sets are local to the per-page call; cross-page state is propagated only for unique indexes via removedKeys (:669). For a non-unique index, remove(keys,rid) writes a per-RID tombstone into the current last page while the original entry lives in an older page (or the compacted sub-index). get() walks newest->oldest: the newer page records the tombstone in its local deletedRIDs and discards it on return; the older page starts empty and adds the deleted RID to the result. Deleted entries reappear in WHERE prop = x index lookups. The cursor path handles this correctly via cross-cursor ridState, so point lookups and range scans disagree on the same data. validRIDs is dead code.
Fix: hoist deletedRIDs to the caller and thread it through searchInNonCompactedIndex -> lookupInPageAndAddInResultset -> searchInCompactedIndex, like removedKeys; delete validRIDs. Regression test: non-unique index, tombstone in a later page (or compacted), get(K) must be empty.
Filed from an internal engine deep-audit (2026-07). Traced to source; verify against current main before fixing and add a regression test.
Fixed in #4968 (merged). Reproduced: on a non-unique index, get() resurrected a deleted RID whenever the per-RID tombstone and the original ADD lived in different pages, because the deletedRIDs set was local to each page lookup while removedKeys (the unique-index whole-key tombstone set) was already threaded across pages.
deletedRIDs is now threaded through searchInNonCompactedIndex -> lookupInPageAndAddInResultset -> searchInCompactedIndex, exactly like removedKeys, so point lookups agree with the range/cursor path.
Activity
fix(#4945): thread deletedRIDs across pages so non-unique get() canno… (
lvca commentedon Jul 5, 2026
Fixed in #4968 (merged). Reproduced: on a non-unique index,
get()resurrected a deleted RID whenever the per-RID tombstone and the original ADD lived in different pages, because thedeletedRIDsset was local to each page lookup whileremovedKeys(the unique-index whole-key tombstone set) was already threaded across pages.deletedRIDsis now threaded throughsearchInNonCompactedIndex->lookupInPageAndAddInResultset->searchInCompactedIndex, exactly likeremovedKeys, so point lookups agree with the range/cursor path.fix(#4945): thread deletedRIDs across pages so non-unique get() canno… (