-
Notifications
You must be signed in to change notification settings - Fork 1
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
【WIP】feat: Pd init #47
base: unstable
Are you sure you want to change the base?
Conversation
feat: Multi raft
WalkthroughThe changes encompass the integration of Protocol Buffers into the build configuration of the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant PlacementDriverServer
participant Database
participant Raft
Client->>PlacementDriverServer: Add Store Request
PlacementDriverServer->>Database: Check Store Existence
alt Store Exists
PlacementDriverServer->>Raft: Add Node
Raft-->>PlacementDriverServer: Success
else Store Does Not Exist
PlacementDriverServer-->>Client: Error
end
PlacementDriverServer-->>Client: Store Added Successfully
Note Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
}; | ||
|
||
message GetClusterInfoResponse { | ||
bool success = 1; |
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.
如果是使用status可能可以描述更多失败的场景。
: fake_(fake), pd_group_id_(std::move(pd_group_id)), initial_pd_server_list_(std::move(initial_pd_server_list)) {} | ||
~PlacementDriverOptions() = default; | ||
|
||
bool GetFake(bool fake) { return fake_; } |
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.
这个bool fake参数好像没有用。
return {false, -1}; | ||
} | ||
|
||
max_region_id += 1; |
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.
如果只是+1,写成++就可以。
1、进展:完成了 multi-raft 的改造,并将 PD 模块搭建起来了,目前已经完成了 store 上线的注册功能。
2、后续安排:
(1)添加测试,目前只是简单验证了正确性。
(2)添加根据 key 的范围选择 region 的逻辑,region 对 client 透明。
(3)把 join 命令进一步完善,添加获取 region id 的逻辑。
3、测试:
(1)配置信息设置:
pd 节点:默认端口为 7777,pikiwidb.conf 中 as-pd 设置为 yes。
普通节点:默认端口为 8888,pikiwidb.conf 中 as-pd 设置为 no。
这里不管是 pd 节点还是普通节点都需要设置 pd 的成员配置信息:
如果想要构建 pd 三节点的话,可以自己适当的增加成员配置。
(2)启动 pd 节点:
启动 pd 节点,默认会自己创建 region 0(即 db 0),用来存储集群的元数据。
(3)启动普通节点:
(4)查询注册信息:
4、设计文档:
https://m0jlcucyhxm.feishu.cn/docx/F2qMd0eRUotvrdxAHBdcpx5yn5Q
Summary by CodeRabbit
New Features
PlacementDriverService
with RPC methods for managing clusters, including adding/removing stores and retrieving cluster information.PlacementDriverServer
to manage placement driver operations.Configuration Changes
Bug Fixes
Documentation