rocksdb/tools
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
..
dump Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
rdb fixed typo 2017-06-05 11:27:34 -07:00
auto_sanity_test.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
benchmark_leveldb.sh Add scripts to run leveldb benchmark 2015-04-27 19:32:56 -07:00
benchmark.sh remove deleted option from benchmark.sh 2017-03-21 12:54:13 -07:00
blob_dump.cc Simple blob file dumper 2017-05-23 10:42:59 -07:00
check_format_compatible.sh Revert how check_format_compatible.sh checkout release branches. 2017-04-20 11:06:09 -07:00
CMakeLists.txt cmake support for linux and osx (#1358) 2016-09-28 11:53:15 -07:00
db_bench_tool_test.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_bench_tool.cc Call RateLimiter for compaction reads 2017-06-13 14:56:46 -07:00
db_bench.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_crashtest.py fix db_stress crash caused by buggy kernel warning 2017-04-11 16:56:59 -07:00
db_repl_stress.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_sanity_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_stress.cc Call RateLimiter for compaction reads 2017-06-13 14:56:46 -07:00
dbench_monitor Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
Dockerfile adding docker build script and dockerfile 2015-05-22 16:03:39 -07:00
generate_random_db.sh Script to check whether RocksDB can read DB generated by previous releases and vice versa 2015-04-08 16:04:59 -07:00
ldb_cmd_impl.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
ldb_cmd_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
ldb_cmd.cc Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
ldb_test.py Add GetAllKeyVersions API 2017-05-12 15:54:06 -07:00
ldb_tool.cc Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
ldb.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
pflag Added simple monitoring script to monitor overusage of memory in db_bench 2015-02-11 18:40:11 -08:00
reduce_levels_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
regression_test.sh remove test dir before exit when current regression is running 2017-06-02 17:26:19 -07:00
rocksdb_dump_test.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
run_flash_bench.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
run_leveldb.sh AIX and Solaris Sparc Support 2017-04-21 20:48:04 -07:00
sample-dump.dmp First version of rocksdb_dump and rocksdb_undump. 2015-06-19 16:24:36 -07:00
sst_dump_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
sst_dump_tool_imp.h Move some files under util/ to separate dirs 2017-04-05 19:09:16 -07:00
sst_dump_tool.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
sst_dump.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
verify_random_db.sh tools/check_format_compatible.sh to cover option file loading too 2017-04-20 10:26:37 -07:00
write_stress_runner.py Write stress test 2015-10-28 16:15:07 -07:00
write_stress.cc fixed typo 2017-05-16 11:07:58 -07:00