From 51eadcf59a22911e04000c98f5021c5246d46110 Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Wed, 9 Jul 2025 17:27:35 +0100 Subject: [PATCH 1/2] Get server_status message to the raft peering service --- proto/BUILD | 3 +++ proto/raft-peering-service.proto | 3 ++- proto/raft-peering.proto | 25 ++++++++++++++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/proto/BUILD b/proto/BUILD index 72f6c6e..8669204 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -31,6 +31,9 @@ proto_library( proto_library( name = "raft-peering-proto", srcs = [":raft-peering.proto"], + deps = [ + ":server-proto", + ], ) proto_library( diff --git a/proto/raft-peering-service.proto b/proto/raft-peering-service.proto index e87a8e0..b72c681 100644 --- a/proto/raft-peering-service.proto +++ b/proto/raft-peering-service.proto @@ -5,5 +5,6 @@ import "proto/raft-peering.proto"; package typedb.protocol; service RaftPeering { - rpc Peering(PeeringRequest) returns (PeeringResponse); + rpc peering (Peering.Req) returns (Peering.Res); + rpc server_status (ServerStatus.Req) returns (ServerStatus.Res); } \ No newline at end of file diff --git a/proto/raft-peering.proto b/proto/raft-peering.proto index 33a1add..cc9fa18 100644 --- a/proto/raft-peering.proto +++ b/proto/raft-peering.proto @@ -2,11 +2,26 @@ syntax = "proto3"; package typedb.protocol; -message PeeringRequest { - uint64 from_id = 1; - string from_address = 2; - bytes message = 3; +import "proto/server.proto"; + +message Peering { + message Req { + uint64 from_id = 1; + string from_address = 2; + bytes message = 3; + } + + message Res {} } -message PeeringResponse { +message ServerStatus { + message Req {} + + message Res { + // TODO: Currently, it's identical to Server. But it won't necessarily be the case forever, so these fields are + // split. Additionally, we want to highlight that the address is the connection address. + // TODO: We may move ReplicaStatus somewhere else now... + string connection_address = 1; + Server.ReplicaStatus replica_status = 2; + } } From 714241ade3f9501995bac952ec19254d033d3753 Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Wed, 9 Jul 2025 17:42:22 +0100 Subject: [PATCH 2/2] Fix checkstyle --- proto/raft-peering-service.proto | 4 ++++ proto/raft-peering.proto | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/proto/raft-peering-service.proto b/proto/raft-peering-service.proto index b72c681..82301fd 100644 --- a/proto/raft-peering-service.proto +++ b/proto/raft-peering-service.proto @@ -1,3 +1,7 @@ +// 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-peering.proto"; diff --git a/proto/raft-peering.proto b/proto/raft-peering.proto index cc9fa18..8458c68 100644 --- a/proto/raft-peering.proto +++ b/proto/raft-peering.proto @@ -1,3 +1,7 @@ +// 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"; package typedb.protocol;