-
Notifications
You must be signed in to change notification settings - Fork 15
Add cluster support #228
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
Add cluster support #228
Conversation
proto/server.proto
Outdated
string distribution = 1; | ||
string version = 2; | ||
} | ||
} | ||
} | ||
|
||
message Server { |
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.
I don't think we need a separate ServerReplica
message
string address = 1; | ||
} | ||
|
||
message Version { |
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.
Generally, it should be same for every server in the cluster, but its domain is closer to Server
Authentication.Token.Create.Req authentication = 4; | ||
} | ||
|
||
message Res { | ||
uint64 server_duration_millis = 1; | ||
ConnectionID connection_id = 2; | ||
|
||
// pre-send all databases and replica info | ||
DatabaseManager.All.Res databases_all = 3; |
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.
We removed an excessive driver-side cache, so it's no longer utilized. Plus, overall, it's unclear which replica to trust in the first place, so we removed the databases from this initial response. The process of getting the databases will run through the regular APIs with the knowledge of which replica is the most trusted one.
proto/connection.proto
Outdated
// pre-send all databases and replica info | ||
DatabaseManager.All.Res databases_all = 3; | ||
|
||
ServerManager.All.Res servers_all = 3; // TODO: It might not be used / needed in the end! Discuss. |
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.
I think it's useful to have. When initing the connection, I receive both the connection and the list of servers, and the list of servers is needed to continue creating connections. Thus, if it's cheap, it's better to provide it instead of requiring a second call which can fail.
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.
Verified it over time, it's a good thing to have. I will remove the todo before merging if you're happy.
94560a8
into
typedb:cluster-support-feature-branch
## Product change and motivation Update requests and responses to comply with the [new protocol](typedb/typedb-protocol#228). ## Implementation Add a new "server version" message. Change the initial connection response and contents of server and database retrieval responses.
## Product change and motivation Update requests and responses to comply with the [new protocol](typedb/typedb-protocol#228). ## Implementation Add a new "server version" message. Change the initial connection response and contents of server and database retrieval responses.
## Product change and motivation Update requests and responses to comply with the [new protocol](typedb/typedb-protocol#228). ## Implementation Add a new "server version" message. Change the initial connection response and contents of server and database retrieval responses.
## Release notes: usage and product changes Introduce cluster support for TypeDB 3.x, featuring server replicas and the new version message. ## Implementation Remove database replicas. Instead, add server replicas (by extending the usual `Server` message) with a similar set of fields. Instead of adding a `is_primary` flag, introduce an extensible enum `ReplicaType` for more granular split between primary and supporting nodes. To reduce the network overhead, this new information is provided in the initial server's connection response.
Release notes: usage and product changes
Introduce cluster support for TypeDB 3.x, featuring server replicas and the new version message.
Implementation
Remove database replicas. Instead, add server replicas (by extending the usual
Server
message) with a similar set of fields.Instead of adding a
is_primary
flag, introduce an extensible enumReplicaType
for more granular split between primary and supporting nodes.To reduce the network overhead, this new information is provided in the initial server's connection response.