hanahmily commented on code in PR #927:
URL:
https://github.com/apache/skywalking-banyandb/pull/927#discussion_r2668015599
##########
banyand/liaison/grpc/server.go:
##########
@@ -538,6 +540,15 @@ func (s *server) calculateGrpcBufferSizes() (int32, int32)
{
return connWindowSize, streamWindowSize
}
+// GetClusterState returns the current state of all nodes in the cluster.
+func (s *server) GetClusterState(ctx context.Context, _
*databasev1.GetClusterStateRequest) (*databasev1.GetClusterStateResponse,
error) {
+ nodes, err := s.schemaRepo.NodeRegistry().ListNode(ctx,
databasev1.Role_ROLE_UNSPECIFIED)
Review Comment:
Nodes represent the cluster's list of registered nodes, not the routing
table for this specific node. It should return the nodes from the pub package,
including:
1. Received registered nodes: pub.registered
2. Online nodes: pub.active
3. Offline nodes: pub.evictable
##########
api/proto/banyandb/database/v1/rpc.proto:
##########
@@ -684,3 +684,16 @@ message GetCurrentNodeResponse {
service NodeQueryService {
rpc GetCurrentNode(GetCurrentNodeRequest) returns (GetCurrentNodeResponse) {}
}
+
+message GetClusterStateRequest {}
+
+message GetClusterStateResponse {
+ // nodes contains all discovered nodes in the cluster across all roles.
+ repeated banyandb.database.v1.Node nodes = 1;
Review Comment:
```suggestion
// Liaison node: map's key could be "tire1" and "tire2". tire1 route
traffic between liaison nodes, tire2 spread data among data nodes
// Data node: map's key could be "property" for gossip.
// Lifecycle agent: map's key could be the next stage's name.
map<string, RouteTable> route_tables = 1;
```
##########
api/proto/banyandb/database/v1/rpc.proto:
##########
@@ -684,3 +684,16 @@ message GetCurrentNodeResponse {
service NodeQueryService {
rpc GetCurrentNode(GetCurrentNodeRequest) returns (GetCurrentNodeResponse) {}
}
+
+message GetClusterStateRequest {}
+
+message GetClusterStateResponse {
+ // nodes contains all discovered nodes in the cluster across all roles.
+ repeated banyandb.database.v1.Node nodes = 1;
+}
+
Review Comment:
message RouteTable {
repeated banyandb.database.v1.Node registried = 1;
repeated string active = 2;
repeated string evictable = 3;
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]