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

Default try_load_options to true when DB is specified #9937

Closed
wants to merge 2 commits into from

Conversation

jay-zhuang
Copy link
Contributor

If the DB path is specified, the user would expect ldb loads the
options from the path, but it's not:

$ ldb list_live_files_metadata --db=`pwd`

Default try_load_options to true in that case. The user can still
disable that by:

$ ldb list_live_files_metadata --db=`pwd` --try_load_options=false

Test Plan: ldb list_live_files_metadata --db=pwd`` is able to work for
a db generated with different options.num_levels.

@facebook-github-bot
Copy link
Contributor

@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

If the DB path is specified, the user would expect ldb loads the
options from the path, but it's not:
```
$ ldb list_live_files_metadata --db=`pwd`
```
Default `try_load_options` to true in that case. The user can still
disable that by:
```
$ ldb list_live_files_metadata --db=`pwd` --try_load_options=false
```

Test Plan: `ldb list_live_files_metadata --db=`pwd`` is able to work for
a db generated with different options.num_levels.
@facebook-github-bot
Copy link
Contributor

@jay-zhuang has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@jay-zhuang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

ltamasi added a commit to ltamasi/rocksdb that referenced this pull request Jun 3, 2022
Summary:
The patch attempts to fix three bugs in `verify_random_db.sh`:
1) facebook#9937 changed the default for
`--try_load_options` to true in the script's use case, so we have to
explicitly set it to false if the corresponding argument of the script
is 0. This should fix the issue we've been seeing with our forward
compatibility tests where 7.3 is unable to open a database created by
the version on main after adding a new configuration option.
2) The script seemed to have supported two "extra parameters"; however,
in practice, if the second one was set, only that one was passed on to
`ldb`.
3) When running the `diff` command, the base DB directory was passed as
the second argument instead of the file containing the `ldb` output
(this actually seems to work, probably accidentally though).
facebook-github-bot pushed a commit that referenced this pull request Jun 3, 2022
Summary:
The patch attempts to fix three bugs in `verify_random_db.sh`:
1) #9937 changed the default for
`--try_load_options` to true in the script's use case, so we have to
explicitly set it to false if the corresponding argument of the script
is 0. This should fix the issue we've been seeing with our forward
compatibility tests where 7.3 is unable to open a database created by
the version on main after adding a new configuration option.
2) The script seems to support two "extra parameters"; however,
in practice, if the second one was set, only that one was passed on to
`ldb`. Now both get forwarded.
3) When running the `diff` command, the base DB directory was passed as
the second argument instead of the file containing the `ldb` output
(this actually seems to work, probably accidentally though).

Pull Request resolved: #10112

Reviewed By: pdillinger

Differential Revision: D36911363

Pulled By: ltamasi

fbshipit-source-id: fe29db4e28d373cee51a12322c59050fc50e926d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants