-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Make ldb load column family options from OPTIONS file #7847
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anand1976 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -740,7 +744,7 @@ void LDBCommand::PrepareOptions() { | |||
"Non-existing column family " + column_family_name_); | |||
return; | |||
} | |||
column_families_iter->options = options_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, thanks for fixing this!!
options_.max_bytes_for_level_multiplier_additional.resize(options_.num_levels, | ||
void ReduceDBLevelsCommand::OverrideBaseCFOptions( | ||
ColumnFamilyOptions* cf_opts) { | ||
cf_opts->num_levels = old_levels_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to still call the base class's OverrideBaseCFOptions()
for option overrides common to ldb
subcommands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point!
LDBCommand::OverrideBaseOptions(); | ||
|
||
void ChangeCompactionStyleCommand::OverrideBaseCFOptions( | ||
ColumnFamilyOptions* cf_opts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some day we should probably refactor even further and have options only in a DBOptions
and in a std::vector<ColumnFamilyDescriptor>
. When DB doesn't exist and there's no options file, we can prepopulate that vector with a default CF and modify its options there.
Summary: When the --try_load_options is used in conjunction with the --column_family option, ldb incorrectly sets the ColumnFamilyOptions for that column family to defaults. This PR fixes that by retaining from the OPTIONS file and applying command line overrides. Test Plan: Add a unit test in ldb_cmd_test
34a48a8
to
a44fa30
Compare
@anand1976 has updated the pull request. You must reimport the pull request before landing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anand1976 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@anand1976 merged this pull request in 8e7b068. |
Summary: When the --try_load_options is used in conjunction with the --column_family option, ldb incorrectly sets the ColumnFamilyOptions for that column family to defaults. This PR fixes that by retaining from the OPTIONS file and applying command line overrides. Pull Request resolved: facebook#7847 Test Plan: Add a unit test in ldb_cmd_test Reviewed By: ajkr Differential Revision: D25874720 Pulled By: anand1976 fbshipit-source-id: 04bcf23b55e5a30b5b6a59b0e5cb4faef3da7429
When the --try_load_options is used in conjunction with the
--column_family option, ldb incorrectly sets the ColumnFamilyOptions for
that column family to defaults. This PR fixes that by retaining from the
OPTIONS file and applying command line overrides.
Test Plan:
Add a unit test in ldb_cmd_test