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
Conversation
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>
[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. |
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
@@ -0,0 +1,293 @@ | |||
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.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.
2022
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.
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> { |
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.
for Raft Storage, what's the expecting difference between v2 and v1?
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.
The initialization is different.
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | ||
#[repr(u8)] | ||
pub enum PeerTick { |
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 not use V1's implementation as they're identical?
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.
Several ticks will be moved from StoreTick
to PeerTick
.
} | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
pub enum StoreTick { |
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.
Same here. It seems identical to v1.
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.
No, they are different. Several ticks are removed.
} | ||
|
||
/// Message that can be sent to a peer. | ||
pub enum PeerMsg<EK: KvEngine> { |
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.
Comparing with V1, it does not have CasualMessage, HeartbeatPd, Destroy. So are they not needed anymore in v2?
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.
No, I delete them on purpose and add them as needed in future development.
Also regarding the assumptions:
|
Both can be overlapped.
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. |
/LGTM |
/merge |
@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 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: 97a3faa
|
What is changed and how it works?
Issue Number: Ref #12842
What's Changed:
Check List
Tests
Release note