rocksdb/options
Sagar Vemuri 89ad9f3adb Allow ignoring unknown options when loading options from a file
Summary:
Added a flag, `ignore_unknown_options`, to skip unknown options when loading an options file (using `LoadLatestOptions`/`LoadOptionsFromFile`) or while verifying options (using `CheckOptionsCompatibility`). This will help in downgrading the db to an older version.

Also added `--ignore_unknown_options` flag to ldb

**Example Use case:**
In MyRocks, if copying from newer version to older version, it is often impossible to start because of new RocksDB options that don't exist in older version, even though data format is compatible.
MyRocks uses these load and verify functions in [ha_rocksdb.cc::check_rocksdb_options_compatibility](e004fd9f41/storage/rocksdb/ha_rocksdb.cc (L3348-L3401)).

**Test Plan:**
Updated the unit tests.
`make check`

ldb:
$ ./ldb --db=/tmp/test_db --create_if_missing put a1 b1
OK

Now edit /tmp/test_db/<OPTIONS-file> and add an unknown option.

Try loading the options now, and it fails:
$ ./ldb --db=/tmp/test_db --try_load_options get a1
Failed: Invalid argument: Unrecognized option DBOptions:: abcd

Passes with the new --ignore_unknown_options flag
$ ./ldb --db=/tmp/test_db --try_load_options --ignore_unknown_options get a1
b1
Closes https://github.com/facebook/rocksdb/pull/2423

Differential Revision: D5212091

Pulled By: sagar0

fbshipit-source-id: 2ec17636feb47dc0351b53a77e5f15ef7cbf2ca7
2017-06-13 16:58:01 -07:00
..
cf_options.cc Call RateLimiter for compaction reads 2017-06-13 14:56:46 -07:00
cf_options.h Call RateLimiter for compaction reads 2017-06-13 14:56:46 -07:00
db_options.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_options.h Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
options_helper.cc Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
options_helper.h Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
options_parser.cc Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
options_parser.h Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
options_sanity_check.cc Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
options_sanity_check.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
options_settable_test.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
options_test.cc Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
options.cc Reorder variables of ReadOptions 2017-05-26 11:41:20 -07:00