DBImpl::DoCompactionWork decides to finish current output if current output file is big enough or has too much overlap with its grandparents. Seems that keys with same user key but different sequence part may spread to multiple output files in compaction. If this happens, new level compaction may pick the file with newer version key and compact it to elder level. From now on, the key's newer version, which has larger sequence number, is stored in level greater than its old incarnation. If we try to get that key, we will get its old incarnation. See Version::Get for implementation details.
I push a pull request #375 to fix this. Any maintainer here to review that pull request ?