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

engine_traits: clean up sst iterator #13277

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Aug 12, 2022

What is changed and how it works?

Issue Number: Ref #13058

What's Changed:

There are 3 notable changes:
- Correctly implement iterator for `SstReader`.
- Remove unnecessary methods.
- Make interface taking mutable references correctly.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

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>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Connor1996
  • tabokie

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 12, 2022
@BusyJay
Copy link
Member Author

BusyJay commented Aug 12, 2022

/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 {
Copy link
Member Author

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));
Copy link
Member

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

Copy link
Member Author

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>
@@ -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)
Copy link
Member

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>
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 15, 2022
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 15, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 15, 2022
@5kbpers
Copy link
Member

5kbpers commented Aug 15, 2022

/merge

@ti-chi-bot
Copy link
Member

@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 /merge once, and 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.

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: aa703d8

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 15, 2022
@ti-chi-bot
Copy link
Member

@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.

@ti-chi-bot ti-chi-bot merged commit 8be9d44 into tikv:master Aug 15, 2022
@ti-chi-bot ti-chi-bot added this to the Pool milestone Aug 15, 2022
@BusyJay BusyJay deleted the further-cleanup-engine-traits branch August 15, 2022 09:27
fengou1 pushed a commit to fengou1/tikv that referenced this pull request Aug 30, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants