RaftService
Raft consensus inter-node protocol (gRPC-only, no REST — internal). Uses opaque bytes for openraft type serialization (msgpack). This decouples the proto schema from openraft's internal generic types, making the protocol stable across openraft version upgrades.
Internal API
This service is used for inter-node communication only. It is not intended for external clients and may change without notice.
Proto source
Methods
Vote
Leader election vote (unary). Payload: msgpack(VoteRequest) → msgpack(VoteResponse)
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
AppendEntries
Log replication (unary, single batch). Used as fallback when streaming is not available. Payload: msgpack(AppendEntriesRequest) → msgpack(AppendEntriesResponse)
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
StreamAppend
Pipeline log replication (bidirectional streaming). Leader streams AppendEntriesRequest, follower streams StreamAppendResult. This is the primary replication path — higher throughput than unary.
Transport: Server-streaming gRPC only (no HTTP transcoding)
Request: stream RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Response: stream RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Snapshot
Snapshot transfer (client streaming). Leader streams snapshot chunks, follower responds with ack.
Request: stream RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
TransferLeader
Leadership transfer (unary).
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | — |
Response: RaftEmpty
Empty response (no fields).
Types
RaftEmpty
Empty response for fire-and-forget RPCs.
No fields.
RaftPayload
Opaque payload containing msgpack-serialized openraft types.
| Field | Type | Description |
|---|---|---|
data | bytes | — |
