rocksdb/include/rocksdb
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
..
utilities Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
advanced_options.h fixed typo 2017-06-13 16:58:01 -07:00
c.h Add missing index type to C-API 2017-06-01 11:27:04 -07:00
cache.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
cleanable.h Pinnableslice (2nd attempt) 2017-03-13 11:54:10 -07:00
compaction_filter.h Fix interaction between CompactionFilter::Decision::kRemoveAndSkipUnt… 2017-06-02 15:11:38 -07:00
compaction_job_stats.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
comparator.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
convenience.h Allow ignoring unknown options when loading options from a file 2017-06-13 16:58:01 -07:00
db_bench_tool.h Separeate main from bench functionality to allow cusomizations 2016-02-16 06:17:31 -08:00
db_dump_tool.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
env.h Allow SstFileWriter to use the rate limiter 2017-05-23 11:42:09 -07:00
experimental.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
filter_policy.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
flush_block_policy.h Configure index partition size 2017-03-28 12:09:12 -07:00
iostats_context.h using ThreadLocalPtr to hide ROCKSDB_SUPPORT_THREAD_LOCAL from public… 2017-06-02 17:26:19 -07:00
iterator.h Pinnableslice (2nd attempt) 2017-03-13 11:54:10 -07:00
ldb_tool.h Allow Users to change customized ldb tools' header in help printing 2017-03-21 17:39:12 -07:00
listener.h Allow IntraL0 compaction in FIFO Compaction 2017-05-04 18:16:13 -07:00
memtablerep.h Improve write buffer manager (and allow the size to be tracked in block cache) 2017-06-02 14:26:56 -07:00
merge_operator.h [rocksdb][PR] Remove option min_partial_merge_operands and verify_checksums_in_comp… 2017-02-23 15:09:12 -08:00
metadata.h Sample number of reads per SST file 2017-06-12 07:12:08 -07:00
options.h WriteOptions.low_pri which can throttle low pri writes if needed 2017-06-05 15:02:35 -07:00
perf_context.h using ThreadLocalPtr to hide ROCKSDB_SUPPORT_THREAD_LOCAL from public… 2017-06-02 17:26:19 -07:00
perf_level.h using ThreadLocalPtr to hide ROCKSDB_SUPPORT_THREAD_LOCAL from public… 2017-06-02 17:26:19 -07:00
persistent_cache.h Dump persistent cache options 2016-12-19 14:09:12 -08:00
rate_limiter.h Call RateLimiter for compaction reads 2017-06-13 14:56:46 -07:00
slice_transform.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
slice.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
snapshot.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
sst_dump_tool.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
sst_file_manager.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
sst_file_writer.h fixed typo 2017-06-13 16:58:01 -07:00
statistics.h Histogram of number of merge operands 2017-05-31 07:41:44 -07:00
status.h Limit maximum memory used in the WriteBatch representation 2017-04-10 15:42:26 -07:00
table_properties.h record index partition properties 2017-06-13 11:21:32 -07:00
table.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
thread_status.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
threadpool.h New API for background work in single thread pool 2017-05-23 11:12:27 -07:00
transaction_log.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
types.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
universal_compaction.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
version.h bump version to 5.6 2017-06-05 16:15:21 -07:00
wal_filter.h Avoid overloaded virtual function 2016-03-22 17:10:31 -07:00
write_batch_base.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
write_batch.h Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
write_buffer_manager.h Improve write buffer manager (and allow the size to be tracked in block cache) 2017-06-02 14:26:56 -07:00