]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Allow DB reopen with reduced options.num_levels
authorYi Wu <yiwu@fb.com>
Thu, 24 Aug 2017 23:05:16 +0000 (16:05 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 24 Aug 2017 23:10:54 +0000 (16:10 -0700)
commit3c840d1a6dc194a6dcdbf886b0438dc176804c44
treee80580d763f49d2ddb8f62e48406e44857c7bef6
parent92bfd6c5078fa7bbf7a2caacfddbec255e9098ba
Allow DB reopen with reduced options.num_levels

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
db/db_test2.cc
db/version_builder.cc
db/version_builder.h
db/version_set.cc