ask follower to follow

This commit is contained in:
chrislu
2024-03-10 14:34:28 -07:00
parent c1a5952009
commit 6f75a0af55
11 changed files with 1362 additions and 316 deletions

View File

@@ -45,6 +45,11 @@ service SeaweedMessaging {
}
rpc SubscribeMessage (SubscribeMessageRequest) returns (stream SubscribeMessageResponse) {
}
// The lead broker asks a follower broker to follow itself
rpc PublishFollowMe (PublishFollowMeRequest) returns (PublishFollowMeResponse) {
}
rpc FollowInMemoryMessages (FollowInMemoryMessagesRequest) returns (stream FollowInMemoryMessagesResponse) {
}
}
//////////////////////////////////////////////////
@@ -205,6 +210,14 @@ message PublishMessageResponse {
string error = 2;
bool should_close = 3;
}
message PublishFollowMeRequest {
Topic topic = 1;
Partition partition = 2;
string broker_self = 3;
}
message PublishFollowMeResponse {
string error = 1;
}
message SubscribeMessageRequest {
message InitMessage {
string consumer_group = 1;
@@ -233,6 +246,32 @@ message SubscribeMessageResponse {
DataMessage data = 2;
}
}
message FollowInMemoryMessagesRequest {
message InitMessage {
string consumer_group = 1;
string consumer_id = 2;
int32 follower_id = 3;
Topic topic = 4;
PartitionOffset partition_offset = 5;
}
message AckMessage {
int64 sequence = 1;
}
oneof message {
InitMessage init = 1;
AckMessage ack = 2;
}
}
message FollowInMemoryMessagesResponse {
message CtrlMessage {
int64 flushed_sequence = 1;
int32 follower_changed_to_id = 2;
}
oneof message {
CtrlMessage ctrl = 1;
DataMessage data = 2;
}
}
message ClosePublishersRequest {
Topic topic = 1;
int64 unix_time_ns = 2;