compaction filter 如果返回的是 kRemove 类型,不是直接被清理掉,而是被重置为一个tombstone;
代码在 CompactionIterator::InvokeFilterIfNeeded 中:
if (filter == CompactionFilter::Decision::kRemove) {
// convert the current key to a delete; key_ is pointing into
// current_key_ at this point, so updating current_key_ updates key()
ikey_.type = kTypeDeletion;
current_key_.UpdateInternalKey(ikey_.sequence, kTypeDeletion);
// no value associated with delete
value_.clear();
iter_stats_.num_record_drop_user++;
}