rocksdb/options
Yanqin Jin 98174bc3a3 Hack to load OPTIONS file for read_amp_bytes_per_bit (#7659)
Summary:
A temporary hack to work around a bug in 6.10, 6.11, 6.12, 6.13 and
6.14. The bug will write out 8 bytes to OPTIONS file from the starting
address of BlockBasedTableOptions.read_amp_bytes_per_bit which is
actually a uint32. Consequently, the value of read_amp_bytes_per_bit
written in the OPTIONS file is wrong. From 6.15, RocksDB will
try to parse the read_amp_bytes_per_bit from OPTIONS file as a uint32.
To be able to load OPTIONS file generated by affected releases before
the fix, we need to manually parse read_amp_bytes_per_bit with this hack.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7659

Test Plan:
Generate a db with current 6.14.fb (head at b6db05dbb5). Maybe use db_stress.

Checkout this PR, run
```
 ~/rocksdb/ldb --db=. --try_load_options --ignore_unknown_options idump --count_only
```
Expect success, and should not see
```
Failed: Invalid argument: Error parsing read_amp_bytes_per_bit:17179869184
```

Also
make check

Reviewed By: anand1976

Differential Revision: D24954752

Pulled By: riversand963

fbshipit-source-id: c7b802fc3e52acd050a4fc1cd475016122234394
2020-11-15 15:10:54 -08:00
..
cf_options.cc SST Partitioner interface that allows to split SST files (#6957) 2020-07-24 13:44:49 -07:00
cf_options.h SST Partitioner interface that allows to split SST files (#6957) 2020-07-24 13:44:49 -07:00
db_options.cc Make max_subcompactions dynamically changeable (#7159) 2020-07-22 18:32:52 -07:00
db_options.h Make max_subcompactions dynamically changeable (#7159) 2020-07-22 18:32:52 -07:00
options.cc SST Partitioner interface that allows to split SST files (#6957) 2020-07-24 13:44:49 -07:00
options_helper.cc Make max_subcompactions dynamically changeable (#7159) 2020-07-22 18:32:52 -07:00
options_helper.h Add Struct Type to OptionsTypeInfo (#6425) 2020-05-21 10:58:39 -07:00
options_parser.cc Add Struct Type to OptionsTypeInfo (#6425) 2020-05-21 10:58:39 -07:00
options_parser.h Add Functions to OptionTypeInfo (#6422) 2020-04-28 18:04:26 -07:00
options_settable_test.cc SST Partitioner interface that allows to split SST files (#6957) 2020-07-24 13:44:49 -07:00
options_test.cc Hack to load OPTIONS file for read_amp_bytes_per_bit (#7659) 2020-11-15 15:10:54 -08:00
options_type.h Add OptionTypeInfo::Vector to parse/serialize vectors (#6424) 2020-06-03 12:23:07 -07:00