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_trait: introduce status error #13059

Merged
merged 13 commits into from
Jul 22, 2022
Merged

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Jul 19, 2022

What is changed and how it works?

Issue Number: Ref #13058

What's Changed:

This PR is the first step to prepare for tirocks, the new rocksdb wrapper.

The status error is introduced and iterator trait is refactored to keep
consistent with tirocks.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

This PR is the first step to prepare for tirocks, the new rocksdb wrapper.

The status error is introduced and iterator trait is refactored to keep
consistent with tirocks.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 19, 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 19, 2022
components/engine_traits/src/iterable.rs Outdated Show resolved Hide resolved
components/engine_traits/src/iterable.rs Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2022
Co-authored-by: Xinye Tao <xy.tao@outlook.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
/// A macro that will transform a rocksdb error to engine trait error.
///
/// r stands for rocksdb, e stands for engine_trait.
macro_rules! r2e {
Copy link
Member

Choose a reason for hiding this comment

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

can we implement From for error and avoid using macro

Copy link
Member Author

Choose a reason for hiding this comment

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

No, because neither types are defined by engine_rocks.

Copy link
Member

Choose a reason for hiding this comment

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

how about adding intermediate type in engine_rocks

Copy link
Member Author

Choose a reason for hiding this comment

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

Then the type needs to be constructed every where. You can't build up such connections that just using ? to convert two foreign types.

Copy link
Member

Choose a reason for hiding this comment

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

how about shortening from_rocksdb_error to r2e. Writing xxx().map_err(r2e) is more readible than r2e!(xxx())

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2022
/// A macro that will transform a rocksdb error to engine trait error.
///
/// r stands for rocksdb, e stands for engine_trait.
macro_rules! r2e {
Copy link
Contributor

Choose a reason for hiding this comment

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

what about rocks2engine_error so it's no need to see the definition to understand what it does.

Copy link
Member Author

Choose a reason for hiding this comment

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

The name is too long to be written everywhere.

/// A trait that will transform a engine trait error to rocksdb error.
///
/// r stands for rocksdb, e stands for engine_trait.
macro_rules! e2r {
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, engine2rocks_error?

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 21, 2022
@BusyJay
Copy link
Member Author

BusyJay commented Jul 22, 2022

/merge

@ti-chi-bot
Copy link
Member

@BusyJay: 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: 6a07901

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

BusyJay commented Jul 22, 2022

/test

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
…duce-status

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jul 22, 2022
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@BusyJay
Copy link
Member Author

BusyJay commented Jul 22, 2022

/merge

@ti-chi-bot
Copy link
Member

@BusyJay: 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: 3ece129

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 22, 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.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
…duce-status

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jul 22, 2022
@BusyJay
Copy link
Member Author

BusyJay commented Jul 22, 2022

/merge

@ti-chi-bot
Copy link
Member

@BusyJay: 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: 294a558

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 22, 2022
@ti-chi-bot ti-chi-bot merged commit 6e66f09 into tikv:master Jul 22, 2022
@ti-chi-bot ti-chi-bot added this to the Pool milestone Jul 22, 2022
@BusyJay BusyJay deleted the introduce-status branch July 23, 2022 03:25
LintianShi pushed a commit to LintianShi/tikv that referenced this pull request Jul 27, 2022
ref tikv#13058

This PR is the first step to prepare for tirocks, the new rocksdb wrapper.

The status error is introduced and iterator trait is refactored to keep
consistent with tirocks.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Co-authored-by: Xinye Tao <xy.tao@outlook.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/XXL Denotes a PR that changes 1000+ 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