-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
engine_traits: clean up sst iterator #13277
engine_traits: clean up sst iterator #13277
Conversation
There are 3 notable changes: - Correctly implement iterator for `SstReader`. - Remove unnecessary methods. - Make interface taking mutable references correctly. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @3pointer as importer uses sst iterator a lot. |
|
||
let start_key = keys::enc_start_key(region); | ||
let end_key = keys::enc_end_key(region); | ||
for cf in cf_names { | ||
for cf in ALL_CFS { |
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.
If cf list is changed between versions, this check can fail. But it can also fail in the old implementation.
/// Build an `IterOptions` using giving data key bound. Empty upper bound will | ||
/// be ignored. | ||
pub fn iter_option(lower_bound: &[u8], upper_bound: &[u8], fill_cache: bool) -> IterOptions { | ||
let lower_bound = Some(KeyBuilder::from_slice(lower_bound, 0, 0)); |
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.
why is different from the previous, DATA_KEY_PREFIX_LEN
is not passed
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.
I think the old implementation is wrong because no prefix is set afterwards.
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
components/engine_rocks/src/misc.rs
Outdated
@@ -127,7 +127,7 @@ impl RocksEngine { | |||
} | |||
|
|||
impl MiscExt for RocksEngine { | |||
fn flush(&self, sync: bool) -> Result<()> { | |||
fn flush_cfs(&self, sync: bool) -> Result<()> { | |||
self.as_inner().flush(sync).map_err(r2e) |
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.
Isn't this an alias for flush default cf?
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
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
/merge |
@5kbpers: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: aa703d8
|
@BusyJay: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
ref tikv#13058 There are 3 notable changes: - Correctly implement iterator for `SstReader`. - Remove unnecessary methods. - Make interface taking mutable references correctly. Signed-off-by: Jay Lee <BusyJayLee@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: fengou1 <feng.ou@pingcap.com>
What is changed and how it works?
Issue Number: Ref #13058
What's Changed:
Check List
Tests
Release note