recid is not returned to RECID_LONG_STACK after preallocate+delete
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5.1k
- Forks
- 877
- PR merge metrics
- No merged PRs in 30d
Description
MapDb 3.0.8. StoreWAL and StoreDirect do not releaseRecid if oldSize == NULL_RECORD_SIZE, thus preallocating and deleting a recid (without ever writing a value to it) will cause the recid not to be reused.
Compare:
long r1 = store.preallocate();
store.update(r1, 1, Serializer.INTEGER);
store.delete(r1, Serializer.INTEGER);
long r2 = store.preallocate();
with:
long r1 = store.preallocate();
store.delete(r1, Serializer.INTEGER);
long r2 = store.preallocate();
In the first case r1==r2, but the second one results in r1!=r2
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
Inspect the preallocate and delete paths in StoreWAL and StoreDirect, focusing on handling when oldSize == NULL_RECORD_SIZE. Reproduce both examples from the issue and verify that deleting an unused preallocated recid allows the next preallocate call to return the same recid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100