Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable ignore_unknown_options only for lower version #256

Merged
merged 2 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions options/options_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ Status RocksDBOptionsParser::Parse(const ConfigOptions& config_options_in,
return s;
}

// If the option file is not generated by a higher minor version,
// If the option file is generated by a lower minor version,
// there shouldn't be any unknown option.
if (ignore_unknown_options && section == kOptionSectionVersion) {
if (db_version[0] < ROCKSDB_MAJOR || (db_version[0] == ROCKSDB_MAJOR &&
db_version[1] <= ROCKSDB_MINOR)) {
if (db_version[0] < ROCKSDB_MAJOR ||
(db_version[0] == ROCKSDB_MAJOR && db_version[1] < ROCKSDB_MINOR)) {
ignore_unknown_options = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion options/options_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ TEST_F(OptionsParserTest, IgnoreUnknownOptions) {
bool should_ignore = true;
if (case_id == 0) {
// same version
should_ignore = false;
should_ignore = true;
version_string =
ToString(ROCKSDB_MAJOR) + "." + ToString(ROCKSDB_MINOR) + ".0";
} else if (case_id == 1) {
Expand Down