feat: rpc message based heartbeat (#30)

* feat: rpc message based heartbeat

* chore: by cr
This commit is contained in:
JeremyHi
2023-04-26 18:59:45 +08:00
committed by GitHub
parent a26c40c004
commit e8abf8241c
3 changed files with 27 additions and 3 deletions
+18 -1
View File
@@ -32,6 +32,7 @@ message HeartbeatRequest {
repeated RegionStat region_stats = 6;
// Follower nodes and stats, empty on follower nodes
repeated ReplicaStat replica_stats = 7;
repeated MailboxMessage mailbox_messages = 8;
}
message NodeStat {
@@ -80,7 +81,7 @@ message ReplicaStat {
message HeartbeatResponse {
ResponseHeader header = 1;
repeated bytes payload = 2;
repeated MailboxMessage mailbox_messages = 2;
}
message AskLeaderRequest {
@@ -92,3 +93,19 @@ message AskLeaderResponse {
Peer leader = 2;
}
message MailboxMessage {
// The id is used to associate request and response.
uint64 id = 1;
// The following information plays a bigger role in making messages traceable and facilitating debugging.
string subject = 2;
string from = 3;
string to = 4;
// The unix timestamp in milliseconds.
int64 timestamp_millis = 5;
// The message body.
oneof payload {
string json = 6;
}
}