-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add verification on mergeSpans #772
Conversation
3f4ad0f
to
a792979
Compare
There shouldn't have any duplicated free page IDs, or overlap between the new free page IDs and the existing free page IDs. Signed-off-by: Benjamin Wang <[email protected]>
a792979
to
3c0d2ee
Compare
/lgtm thanks for adding those, let's see if we can find some triggers of this |
this is highly off topic here, but I wonder if we can also implement a much simpler freelist with plain bitsets. We would have a much more compact in-memory representation and would get unions/intersections for free. Had some good experience with github.com/bits-and-blooms/bitset recently while creating that defrag/page usage video. |
I am not satisfied with the bbolt freelist management for a long time. I have been thinking how to refactor it and improve the situation. I am open to any idea on this and happy to discuss it further. Will take a look at github.com/bits-and-blooms/bitset later. |
There isn't a clear interface and hard to understand. I am thinking to
|
yep, that would also be my first course of action. Pull the two implementations under a common interface, then have proper testing for those. |
I just had a quick look at the project. It seems not quite related to our usage o freelist management. It manages a mapping between non-negative integers and boolean values; while bbolt freelist management just needs to remember a list of free page IDs. If you still think it might be helpful or related, please feel free to raise a separate ticket to discuss. thx |
will do. You can use a bitset to map from PageId->Free/Used. Since you're packing 64 bools into one int64, you have a much lower memory/file usage. Finding continuous free blocks is also cheaper, since you can just bitshift along the int64. |
It might be helpful to detect issue such as #705
cc @fuweid @tjungblu