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

raftstorev2: add basic layout #12843

Merged
merged 2 commits into from Jun 18, 2022
Merged

raftstorev2: add basic layout #12843

merged 2 commits into from Jun 18, 2022

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Jun 16, 2022

What is changed and how it works?

Issue Number: Ref #12842

What's Changed:

This is an attempt to reimplement raftstore using the new assumptions
that peer's range can be overlapped.

Currently, compatability is not considered, though we may think about
how to migrate from old version by the end of this year.

No concrete implementations is added yet, we may choose reuse
implementation from v1 or implementing new logic base on actual
requirement. The principle is
1. do not introduce history debt while reusing code as much as possible.
2. do not change the current implementations.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

This is an attempt to reimplement raftstore using the new assumptions
that peer's range can be overlapped.

Currently, compatability is not considered, though we may think about
how to migrate from old version by the end of this year.

No concrete implementations is added yet, we may choose reuse
implementation from v1 or implementing new logic base on actual
requirement. The principle is do not introduce history debt while reusing
code as much as possible.

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

ti-chi-bot commented Jun 16, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • tonyxuqqi
  • zhangjinpeng1987

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.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@Connor1996 Connor1996 self-requested a review June 17, 2022 05:58
Make region size dynamic automation moved this from In progress to Reviewer approved Jun 17, 2022
Copy link
Member

@zhangjinpeng87 zhangjinpeng87 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 Status: PR - There is already 1 approval label Jun 17, 2022
@@ -0,0 +1,293 @@
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
Copy link
Contributor

Choose a reason for hiding this comment

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

2022

Copy link
Contributor

Choose a reason for hiding this comment

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

ASF suggests using the interception year of the project consistently for all its files. But of course it's not a requirement.

logger: Logger,
}

impl<ER> Storage<ER> {
Copy link
Contributor

Choose a reason for hiding this comment

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

for Raft Storage, what's the expecting difference between v2 and v1?

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 initialization is different.


#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(u8)]
pub enum PeerTick {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use V1's implementation as they're identical?

Copy link
Member Author

Choose a reason for hiding this comment

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

Several ticks will be moved from StoreTick to PeerTick.

}

#[derive(Debug, Clone, Copy)]
pub enum StoreTick {
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. It seems identical to v1.

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, they are different. Several ticks are removed.

}

/// Message that can be sent to a peer.
pub enum PeerMsg<EK: KvEngine> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Comparing with V1, it does not have CasualMessage, HeartbeatPd, Destroy. So are they not needed anymore in v2?

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, I delete them on purpose and add them as needed in future development.

@tonyxuqqi
Copy link
Contributor

Also regarding the assumptions:

  1. peer's range can be overlapped: do you mean the actual tablet's data range or the region's range.
  2. "Currently, compatability is not considered, though we may think about
    how to migrate from old version by the end of this year", does it mean the TiKV won't work for both version until this end of the year? (Or do you mean we will essentially two version of tikv?)

@BusyJay
Copy link
Member Author

BusyJay commented Jun 17, 2022

1. peer's range can be overlapped: do you mean the actual tablet's data range or the region's range.

Both can be overlapped.

does it mean the TiKV won't work for both version until this end of the year? (Or do you mean we will essentially two version of tikv?)

Yes, it will work with either one but not both at the same time. There will be only one version TiKV while can start with different version of raftstore.

@ti-chi-bot ti-chi-bot added status/LGT2 Status: PR - There are already 2 approvals and removed status/LGT1 Status: PR - There is already 1 approval labels Jun 17, 2022
@tonyxuqqi
Copy link
Contributor

/LGTM

@zhangjinpeng87
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@zhangjinpeng1987: 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: 97a3faa

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Jun 18, 2022
@ti-chi-bot ti-chi-bot merged commit c1a09b8 into tikv:master Jun 18, 2022
Make region size dynamic automation moved this from Reviewer approved to Done Jun 18, 2022
@BusyJay BusyJay deleted the raftstorev2 branch June 18, 2022 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/XXL status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Development

Successfully merging this pull request may close these issues.

None yet

5 participants