-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rename Merge.Level to MergeType and extend with MergeUnion enum value #524
base: main
Are you sure you want to change the base?
Conversation
In Test.Database.LSMTree.Internal.Snapshot.Codec, import the general Database.LSMTree.Extras.Generators and use several of the arbitrary instances from there. Remove ones that were duplicates, and remove overlapping instances.
This follows the naming scheme from the prototype. This just adds the new enum (and renames) but does not introduce any new merging behaviour yet, and the new MergeUnion value is not used (except in snapshot (de)serialisation).
3e3cc52
to
64cd6d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't implement the new union merge type yet, right? That's alright, we can do it afterwards, but then there should be a comment/TODO somewhere.
mergeWriteBuffers mergeType = | ||
(if mergeType == MergeLastLevel then Map.filter (not . isDelete) else id) | ||
. Map.unionsWith (Entry.combine mappendValues) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will also need to handle MergeUnion
differently, maybe add a TODO so we don't forget.
mergeWriteBuffers level = | ||
(if level == Merge.LastLevel then Map.filter (not . isDelete) else id) | ||
mergeWriteBuffers mergeType = | ||
(if mergeType == MergeLastLevel then Map.filter (not . isDelete) else id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is where the test failure comes from. Union merges also drop Deletes (https://github.com/IntersectMBO/lsm-tree/pull/524/files#diff-fa33669ac986142f1cd163910716d90a92851522d036426f451e3cd069b0e5e2R393).
Prep for merging trees.