-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Corrupt BTree merge results when duplicate keys leak across common subtree boundaries #20
Comments
lorentey
added a commit
that referenced
this issue
Nov 5, 2016
Merge methods (i.e., set operations) sometimes did not correctly handle duplicate keys at the boundaries of common subtrees. This is extremely hard to reproduce using conventional means. Affected methods: - BTree.distinctUnion - BTree.subtracting - BTree.bagSubtracting - BTree.symmetricDifference - BTree.bagSymmetricDifference - BTree.intersection - BTree.bagIntersection - BTreeMerger.copyCommonElementsFromSecond - BTreeMerger.copyMatchingNumberOfCommonElementsFromSecond - BTreeMerger.skipCommonElements - BTreeMerger.skipMatchingNumberOfCommonElements This fixes issue #20.
There were two distinct sub-bugs:
|
(Unit tests to catch these errors have been added in 8680703.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most of BTree's merge methods have subtle bugs in their common subtree detection logic, which can sometimes lead to corrupt results and/or assertions when duplicate keys cross the boundaries of a common subtree.
It is not easy to reproduce this bug using public API, but the following test manages to do it:
Results on current master branch:
Note how the returned results are often not even sorted correctly.
The bug affects
distinctUnion
,subtracting
,symmetricDifference
,intersection
, and the new bag variants, but notunion
.The text was updated successfully, but these errors were encountered: