Skip to content

Commit 441ac94

Browse files
mregrockgithub-actions[bot]
authored andcommitted
Add BridgeGRpcClient (#19546)
1 parent b58f41e commit 441ac94

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

.github/last_commit.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
693a9330006deec1f2ced3ef39abf3db14e13fc4
1+
032168beb3fb711566abaf1469b1d154c87edb14
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
syntax = "proto3";
2+
3+
package Ydb.Bridge.V1;
4+
5+
option java_package = "com.yandex.ydb.bridge.v1";
6+
option java_outer_classname = "BridgeGrpc";
7+
option java_multiple_files = true;
8+
9+
import "src/api/protos/draft/ydb_bridge.proto";
10+
11+
// Service for managing cluster in bridge mode
12+
service BridgeService {
13+
14+
// Get current cluster state
15+
// Useful for monitoring and decision-making before state changes
16+
rpc GetClusterState(Ydb.Bridge.GetClusterStateRequest) returns (Ydb.Bridge.GetClusterStateResponse);
17+
18+
// Update cluster state by providing a list of desired pile states
19+
// This is the main operation for failover and promotion scenarios
20+
rpc UpdateClusterState(Ydb.Bridge.UpdateClusterStateRequest) returns (Ydb.Bridge.UpdateClusterStateResponse);
21+
22+
}

src/api/protos/draft/ydb_bridge.proto

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
syntax = "proto3";
2+
option cc_enable_arenas = true;
3+
4+
package Ydb.Bridge;
5+
6+
option java_package = "com.yandex.ydb.bridge.proto";
7+
option java_outer_classname = "BridgeProtos";
8+
option java_multiple_files = true;
9+
10+
import "src/api/protos/ydb_operation.proto";
11+
12+
// State of a pile in relation to primary
13+
enum PileState {
14+
DISCONNECTED = 0; // disconnected from the cluster (no connectivity to other piles)
15+
NOT_SYNCHRONIZED = 1; // not synchronized with primary, cannot be promoted
16+
SYNCHRONIZED = 2; // fully synchronized with primary, may be promoted
17+
PROMOTE = 3; // pile is being promoted to primary
18+
PRIMARY = 4; // pile is primary
19+
}
20+
21+
// Pair of pile id and pile state
22+
message PileStateUpdate {
23+
uint32 pile_id = 1;
24+
PileState state = 2;
25+
}
26+
27+
message GetClusterStateRequest {
28+
Ydb.Operations.OperationParams operation_params = 1;
29+
}
30+
31+
message GetClusterStateResponse {
32+
Ydb.Operations.Operation operation = 1;
33+
}
34+
35+
message GetClusterStateResult {
36+
// Current cluster state
37+
repeated PileStateUpdate per_pile_state = 1;
38+
}
39+
40+
message UpdateClusterStateRequest {
41+
Ydb.Operations.OperationParams operation_params = 1;
42+
// List of desired pile states to update
43+
repeated PileStateUpdate updates = 2;
44+
}
45+
46+
message UpdateClusterStateResponse {
47+
Ydb.Operations.Operation operation = 1;
48+
}
49+
50+
message UpdateClusterStateResult {
51+
}

0 commit comments

Comments
 (0)