leveldb
leveldb copied to clipboard
Question about `Compaction::ShouldStopBefore()`
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?