kohler / masstree-beta

Beta release of Masstree.
Other
430 stars 115 forks source link

Inconsistency bug #35

Closed idanlevy1234 closed 4 years ago

idanlevy1234 commented 5 years ago

This issue is about a key that was inserted successfully to the tree but failed to be retrieved or deleted. Inserting the same key again might succeed.

Scenario:

            Thread 1: Inserting a key A. It reaches leaf X (most left leaf) and doesn't find the key A. It's about to insert it to leaf X (before node version validation).
            Thread 2: Inserting multiply keys to leaf X and causing a split in a way key A is not belong to this leaf anymore (should be inserted in a leaf to the right).
            Thread 2: Deleting all keys in leaf X (Leaf X is now empty).
            Thread 1: Notice that the node's version has changed and looking for the next node that should contain the key (in the same layer) but decides to stay in the same leaf while it should have continued to the next leaf. 
idanlevy1234 commented 4 years ago

Fix was validated