leveldb icon indicating copy to clipboard operation
leveldb copied to clipboard

Question about `Compaction::ShouldStopBefore()`

Open cs-qyzhang opened this issue 6 years ago • 0 comments

I am reading leveldb recently. In function DBImpl::DoCompactionWork(), it will call Compaction::ShouldStopBefore for every key. According to file impl.md, Compaction::ShouldStopBefore() is used to avoid that an output file overlaps two much grandparent(level+2) files.

When an output file is too large, it will close and create a new output file. But the state of Compaction::ShouldStopBefore() seems not to change, so overlapped_bytes_ used in Compaction::ShouldStopBefore() will keep rising when a new output file is used. Have I missed something? or it is designed to be so? or it is a bug?

cs-qyzhang avatar Jun 22 '20 08:06 cs-qyzhang