-
Notifications
You must be signed in to change notification settings - Fork 15
Split protocol into 3 separate services #230
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
Merged
farost
merged 13 commits into
typedb:cluster-support-feature-branch
from
farost:cluster-support-ping
Aug 14, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
39e22dc
Rename Peering to Replication, add Ping
farost 81abdd1
Rename GRPC method
farost 8d10443
Rename Replication back to Peering
farost e86bc03
Remove unnecessary fields
farost 09e019e
Introduce TypeDBClustering and Raft services with complete refactoring
farost 3d1aeec
Add ServerManager.Get
farost bc6d7c9
Fix main
farost 8988989
Remove unnecessary req_ids
farost 8724092
Update servers get interface
farost bac7384
Make server manager get req empty
farost 1c7da85
Change Server status Res typoe
farost 9bf0bee
Add replica id to registration req
farost 301dff3
Rename methods
farost File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@typedb_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") | ||
|
||
proto_library( | ||
name = "raft-service", | ||
srcs = ["raft_service.proto"], | ||
deps = [ | ||
":replication-proto", | ||
], | ||
) | ||
|
||
proto_library( | ||
name = "replication-proto", | ||
srcs = ["replication.proto"], | ||
deps = [], | ||
) | ||
|
||
checkstyle_test( | ||
name = "checkstyle", | ||
size = "small", | ||
include = glob(["*"]), | ||
license_type = "mpl-header", | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
syntax = "proto3"; | ||
|
||
import "proto/raft_service/replication.proto"; | ||
|
||
package typedb.protocol; | ||
|
||
// TODO: If the protocol is exposed, maybe it's actually `TypeDBRaft`? | ||
service Raft { | ||
rpc replication (Replication.Req) returns (Replication.Res); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
load("@typedb_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test") | ||
|
||
proto_library( | ||
name = "typedb-clustering-service", | ||
srcs = ["typedb_clustering_service.proto"], | ||
deps = [ | ||
":typedb-clustering-proto", | ||
], | ||
) | ||
|
||
proto_library( | ||
name = "typedb-clustering-proto", | ||
srcs = ["typedb_clustering.proto"], | ||
deps = [ | ||
"//proto/typedb_service:server-proto", | ||
], | ||
) | ||
|
||
checkstyle_test( | ||
name = "checkstyle", | ||
size = "small", | ||
include = glob(["*"]), | ||
license_type = "mpl-header", | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Now that I'm looking into this as a reader, I think the message should be called
Raft
rather thanReplication
. Similarly,RaftService
should have one rpc endpoint,raft
.It's because the message that we exchange are not just replication message, but any messages as defined by the Raft protocol. They can either be "request vote", "append entries" (ie., the message responsible for replication), and "cluster conf change" (ie., add / remove node).
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.
Hmmm okay. I thought that we considered extending this protocol and adding more methods. Your point about vote requests, etc. is reasonable, I'll rename it now.