BTreeMap online compaction
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.1k
- Forks
- 877
- PR merge metrics
- No merged PRs in 30d
Description
MapDB uses B-Linked-Tree described by Lehman and Yao. This is nearly lock-free concurrent structure. Trade-off is that empty tree nodes are not released after deletes. Instead empty nodes are left behind after delete. This may become problem for long-term use.
Current workaround for this fragmentation is to recreate BTreeMap (create new, insert all data, replace original). However there is compaction algorithm which requires minimal locking and can work while tree is online. It is described here:
http://www.doc.ic.ac.uk/~td202/
MapDB should implement this compaction and make it optionally running on back-round thread.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the BTreeMap implementation and reading the linked Lehman–Yao compaction algorithm. Determine how online compaction can run with minimal locking and how a background option would be configured. Done means deleted empty nodes can be compacted while the map remains online, with the behavior optionally enabled in the background.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100