You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all note that I don't really know how LevelDB works internally, I just tried to find out what was causing cpp version of leveldb to be unable to load databases saved by this version...
But in this case we've already called finish and the footer was already written. finish() called flush() which reset dataBlockBuilder.
For empty BlockBuilder, currentSizeEstimate returns SIZE_OF_INT (4), but in this case it shouldn't even be called because the file was already finished
A quick but ugly fix I made was to change:
long currentBytes = compactionState.builder.getFileSize();
to
long currentBytes = compactionState.builder.getFileSize()-SIZE_OF_INT;
And now background compaction seems to work.
The text was updated successfully, but these errors were encountered:
First of all note that I don't really know how LevelDB works internally, I just tried to find out what was causing cpp version of leveldb to be unable to load databases saved by this version...
So in
DbImpl.java
file, around line 1171 we have:The problem is that
getFileSize()
in this case returns file size + 4.That function is:
But in this case we've already called
finish
and the footer was already written.finish()
calledflush()
which resetdataBlockBuilder
.For empty
BlockBuilder
,currentSizeEstimate
returnsSIZE_OF_INT
(4), but in this case it shouldn't even be called because the file was already finishedA quick but ugly fix I made was to change:
to
And now background compaction seems to work.
The text was updated successfully, but these errors were encountered: