• L
    journal log_number correctly in MANIFEST · 453ec52c
    Lei Jin 提交于
    Summary:
    Here is what it can cause probelm:
    There is one memtable flush and one compaction. Both call LogAndApply(). If both edits are applied in the same batch with flush edit first and the compaction edit followed. LogAndApplyHelper() will assign compaction edit current VersionSet's log number(which should be smaller than the log number from flush edit). It cause log_numbers in MANIFEST to be not monotonic increasing, which violates the assume Recover() makes. What is more is after comitting to MANIFEST file, log_number_ in VersionSet is updated to the log_number from the last edit, which is the compaction one. It ends up not updating the log_number.
    
    Test Plan:
    make whitebox_crash_test
    got another assertion about iter->valid(), not sure if that is related
    to this.
    
    Reviewers: igor, haobo
    
    Reviewed By: igor
    
    CC: leveldb
    
    Differential Revision: https://reviews.facebook.net/D16875
    453ec52c
version_set.cc 76.9 KB