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
Most mutations are supposed to invalidate all existing indices, but BTreeIndex only detects invalidation when a mutation deallocates a node that was weakly referenced by the index, or when a slot on the index's path becomes out of bounds.
Make index invalidation strict by storing a mutation count in each node, and making indices verify that the count hasn't changed. The root node needs to be updated for most mutations, so it would be enough to compare its mutation count with the one stored in the index.
Incrementing the mutation count can be done in makeUnique/makeChildUnique, whenever an existing node is reused.
This work could prepare for a potential change that replaces weak references in indices with unowned(unsafe) ones, making indices faster.
The text was updated successfully, but these errors were encountered:
Most mutations are supposed to invalidate all existing indices, but
BTreeIndex
only detects invalidation when a mutation deallocates a node that was weakly referenced by the index, or when a slot on the index's path becomes out of bounds.Make index invalidation strict by storing a mutation count in each node, and making indices verify that the count hasn't changed. The root node needs to be updated for most mutations, so it would be enough to compare its mutation count with the one stored in the index.
Incrementing the mutation count can be done in
makeUnique
/makeChildUnique
, whenever an existing node is reused.This work could prepare for a potential change that replaces weak references in indices with
unowned(unsafe)
ones, making indices faster.The text was updated successfully, but these errors were encountered: