-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Add claude md file for deprecated option removal #14360
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
Open
hx235
wants to merge
1
commit into
facebook:main
Choose a base branch
from
hx235:remove_option_md
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # Removing Deprecated Options from RocksDB | ||
|
|
||
| This document provides guidance on the proper process for removing deprecated options from RocksDB's public API. **Improper removal can break backwards compatibility with old option files.** | ||
|
|
||
| --- | ||
|
|
||
| ## Critical Rule: Never Remove from type_info Structures | ||
|
|
||
| **IMPORTANT:** When removing a deprecated option, you must **keep** the option entry in the `type_info` structures with `OptionVerificationType::kDeprecated`. | ||
|
|
||
| This is because: | ||
| 1. Old option files (e.g., `OPTIONS-xxx` files) generated by previous RocksDB versions may still contain the deprecated option | ||
| 2. When RocksDB reads these old option files, `GetColumnFamilyOptionsFromMap()` or `GetDBOptionsFromMap()` will fail with `InvalidArgument` if the option is not recognized | ||
| 3. Using `kDeprecated` allows the option to be parsed and silently ignored | ||
|
|
||
| **Keep** the entry in the appropriate type_info map with `kDeprecated`. Refer to existing examples: | ||
| - For CF options: see `soft_rate_limit` in `options/cf_options.cc` | ||
| - For DB options: see `new_table_reader_for_compaction_inputs` in `options/db_options.cc` | ||
|
|
||
| --- | ||
|
|
||
| ## Checklist for Removing Deprecated Options | ||
|
|
||
| ### Remove from these files: | ||
| - [ ] Public header (`include/rocksdb/advanced_options.h`, `include/rocksdb/options.h`) | ||
| - [ ] Internal options struct (`options/cf_options.h` or `options/db_options.h`) | ||
| - [ ] `options/options_helper.cc` - `UpdateColumnFamilyOptions()` if mutable CF option | ||
| - [ ] `options/options_settable_test.cc` - test strings | ||
| - [ ] `test_util/testutil.cc` - `RandomInitCFOptions()` or `RandomInitDBOptions()` | ||
| - [ ] `db_stress_tool/db_stress_common.h` - DECLARE macro | ||
| - [ ] `db_stress_tool/db_stress_gflags.cc` - DEFINE macro | ||
| - [ ] `db_stress_tool/db_stress_test_base.cc` - flag usage | ||
| - [ ] `tools/db_bench_tool.cc` - flag definition and usage | ||
| - [ ] `tools/db_crashtest.py` - randomized value entry | ||
| - [ ] `tools/benchmark.sh` - if referenced | ||
| - [ ] `examples/rocksdb_option_file_example.ini` - if referenced | ||
| - [ ] `db/c.cc` - C API implementation | ||
| - [ ] `include/rocksdb/c.h` - C API declaration | ||
| - [ ] Java files (`java/src/main/java/org/rocksdb/*.java`) - if present | ||
| - [ ] `include/rocksdb/convenience.h` - update examples if they reference the option | ||
|
|
||
| ### Keep in these files: | ||
| - [ ] **KEEP** entry in type_info (`options/cf_options.cc` or `options/db_options.cc`) with `OptionVerificationType::kDeprecated` | ||
| - [ ] **KEEP** or add test in `options/options_test.cc` `OptionsOldApiTest::GetOptionsFromMapTest` for loading old option files | ||
|
|
||
| ### Documentation: | ||
| - [ ] Add release note to `HISTORY.md` and `unreleased_history/` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this indirection keep from eating into the context budget when it's not relevant? I hope so because it's a lot of text.