Conversation
a10b859 to
88d31ba
Compare
8e5d232 to
5fbda34
Compare
| filter: | ||
| owner: typedb | ||
| branch: [master] | ||
| branch: [master, cluster-support-feature-branch] |
There was a problem hiding this comment.
TODO: Update protocol version since we break backwards compatibility
| srcs = ["version.proto"], | ||
| ) | ||
|
|
||
| # TODO: THIS SHOULD BE MADE TO STOP EXISTING |
| // pre-send all databases and replica info | ||
| DatabaseManager.All.Res databases_all = 3; | ||
|
|
||
| ServerManager.All.Res servers_all = 3; |
There was a problem hiding this comment.
databases are not actually used or useful. Since replication moved from the database to the server layer, it's only logical to send the list of available servers.
| rpc servers_get (ServerManager.Get.Req) returns (ServerManager.Get.Res); | ||
|
|
||
| // Server API | ||
| rpc server_version (Server.Version.Req) returns (Server.Version.Res); |
There was a problem hiding this comment.
Renamed to follow proto naming conventions (snake_case). Can be rollbacked
| proto_library( | ||
| name = "typedb-service", | ||
| srcs = [":typedb-service.proto"], | ||
| srcs = ["typedb_service.proto"], |
There was a problem hiding this comment.
https://protobuf.dev/programming-guides/style/
While we break some stuff, I thought it might be a good moment to touch this
| @@ -1,5 +1,8 @@ | |||
| Documentation: https://typedb.com/docs/drivers/ | |||
|
|
|||
| **This is an alpha release for CLUSTERED TypeDB 3.x. Do not use this as a stable version of TypeDB.** | |||
|
|
||
| message Server { | ||
| string address = 1; | ||
| optional string address = 1; |
There was a problem hiding this comment.
It contains ONLY the connection address of the grpc endpoint. No serving addresses, no http addresses. I think it's correct.
| "//proto:database-proto", | ||
| "//proto:migration-proto", | ||
| "//proto:error-proto", | ||
| "//proto:analyze-proto", |
There was a problem hiding this comment.
errr do we even still need to support java typedb-protocol
There was a problem hiding this comment.
We don't use it. I just keep supporting it since it's there, maybe somebody depends on it -- it's very cheap for us (you do these global searches of deps anyway). Can be removed easily
| "//proto:database-proto", | ||
| "//proto:migration-proto", | ||
| "//proto:error-proto", | ||
| "//proto:analyze-proto", |
There was a problem hiding this comment.
and also here? Could delete IMO, less maintenance long term
There was a problem hiding this comment.
I'd personally leave this since we still have the nodejs dir in typedb-driver, which is just not updated. If we decide "nah, we're not doing this in the coming years", then we just need to completely remove both.
There was a problem hiding this comment.
i think we can delete it - http seems to work quite well for most people in the js environment IMO. We can always resurrect it if we need to, what do you think @lolski
## 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 Add server_status message to the raft peering service and rename the old raft peering messages to adjust to the existing naming conventions. ## Implementation
Split the protocol into 3 services: * TypeDBService (contains common TypeDB logic): server, database, user, and transaction management, etc. * TypeDBClusteringService (contains TypeDB logic regarding clustering): replica registration, server status. * RaftService (contains Raft logic): replication operations. Split the old RaftPeeringService into TypeDBClusteringService and RaftService. Move separate services and their implementation files into separate subpackages. Rename methods. Introduce `ServersGet` method for single server status retrieval. Introduce `registration` method to verify the replica registration operation before submitting it to Raft.
Add protobuf schema for Raft's 'state mutation request'. The schema defines how the data is transported over the network and stored in the Raft log. - Add a protobuf definition for State Mutation Request - Create a mock RPC endpoint to handle that message as a hack to get the code generator to work
## Release notes: usage and product changes Reorganize Raft service's request messages to mirror the structure of TypeDB service's methods. Additionally, optionalize the Server message to allow returning pure Raft Agent id without other server information available for Clustered operations (in case the replica is not available). ## Implementation I just did it! --------- Co-authored-by: Ganeshwara Hananda <ganesh@vaticle.com> Co-authored-by: Ganeshwara Hananda <ganesh@typedb.com>
## Release notes: usage and product changes Introduce protocol changes required by typedb/typedb-cluster#642 : * User management requests now contain specific request information like username and password hashes (not actual passwords) instead of database commits. ## Implementation
… connection (#242) ## Release notes: usage and product changes Substitute `ServerManager.All.Res` with `ServerManager.Get.Res` in the result of the connection opening message. Returning all servers in a cloud environment does not make sense, since you cannot know the actual address of other servers until you connect to them (they are probably hidden behind proxies, and the GRPC protocol does not even know about them). So, it makes more sense to return only the target server's server information, which helps map the connection address with the id of the replica and all the other parameters for the future requests. ## Implementation
## Release notes: usage and product changes Remove unrelated packages and flatten the project's structure. ## Implementation Move raft and clustering packages to the repo that uses these protocol definitions instead of exposing them here: typedb/typedb-cluster#673
## Release notes: usage and product changes Remove replica registration/deregistration methods from the public protocol as a part of the move to the admin tool. These functions will be available only for the system administrators with access to the server's localhost. Additionally, remove the unnecessary address fields from `Server` messages. ## Implementation
e5eddc0 to
8460b0a
Compare
Release notes: usage and product changes
Introduce cluster support in the TypeDB protocol.
In TypeDB 2.x, each database response carried its own replica list (
DatabaseReplicas). In TypeDB 3.x, servers are the unit of replication, and all databases on that server share the replication context.ServerManager.All.Res(servers with replica status) instead ofDatabaseManager.All.Res(databases with replicas).servers_getRPC to retrieve the specific server's replica status.server_versionRPC to retrieve server distribution and version.DatabaseReplicasmessage. Instead, returnDatabase(name only) instead ofDatabaseReplicas(name + replica info). Replica topology is a server-level concern.Server.ReplicaStatus(replica ID, role, term).Breaking: not compatible with previous versions.
Implementation
server.proto— Extended theServermessage with:optional ReplicaStatus replica_status(field 2) containing replica ID, role enum, and termVersionrequest/response messages for the newserver_versionRPCServerManager.Getrequest/response messages for the newservers_getRPCdatabase.proto— Simplified:DatabaseReplicasmessage and its nestedReplicamessagenamefield (field 1) to theDatabasemessage (previously it only contained nested schema/delete messages)DatabaseManager.Get/All/Createresponses to returnDatabaseinstead ofDatabaseReplicasconnection.proto— Updated handshake:Connection.Open.Resfield 3 changed fromDatabaseManager.All.Res databases_alltoServerManager.All.Res servers_allimport "proto/server.proto"dependencytypedb-service.proto→typedb_service.proto— Renamed to follow proto naming conventions (snake_case). Addedservers_getandserver_versionRPC methods.For the cleanup purposes within a major update, the fields are reorganized, so the users of this protocol will not be compatible with the older versions.