Skip to content
  • Yi Wu's avatar
    Allow DB reopen with reduced options.num_levels · 3c840d1a
    Yi Wu authored
    Summary:
    Allow user to reduce number of levels in LSM by issue a full CompactRange() and put the result in a lower level, and then reopen DB with reduced options.num_levels. Previous this will fail on reopen on when recovery replaying the previous MANIFEST and found a historical file was on a higher level than the new options.num_levels. The workaround was after CompactRange(), reopen the DB with old num_levels, which will create a new MANIFEST, and then reopen the DB again with new num_levels.
    
    This patch relax the check of levels during recovery. It allows DB to open if there was a historical file on level > options.num_levels, but was also deleted.
    Closes https://github.com/facebook/rocksdb/pull/2740
    
    Differential Revision: D5629354
    
    Pulled By: yiwu-arbug
    
    fbshipit-source-id: 545903f6b36b6083e8cbaf777176aef2f488021d
    3c840d1a