mapdb icon indicating copy to clipboard operation
mapdb copied to clipboard

recid is not returned to RECID_LONG_STACK after preallocate+delete

Open javier-godoy opened this issue 4 years ago • 0 comments

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

javier-godoy avatar Feb 18 '21 23:02 javier-godoy