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 | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
PreVote
Pre-vote (unary): whether the receiver would grant a vote at the next term, asked before a candidate raises its term. Nothing is persisted and the receiver's term does not change, so a member cut off from its leader learns it cannot win instead of returning with an inflated term that deposes a healthy leader. Payload: msgpack(VoteRequest) → msgpack(VoteResponse)
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
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 | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
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 | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: stream RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Snapshot
Snapshot transfer (client streaming). Leader streams snapshot chunks, follower responds with ack.
Request: stream RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
TransferLeader
Leadership transfer (unary).
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftEmpty
Empty response (no fields).
Members
The group's members as the answering member knows them, asked by a member that is refusing a peer it does not know yet: a member that missed a membership change, or one still joining. Only a member of the group is answered, and the asker takes the answer only from a member it already knows, so no one becomes a member by asking. Payload: empty → msgpack(the deployment, the log index of the membership and every member's node id, address, node identity and role)
Request: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Response: RaftPayload
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
Types
RaftEmpty
Empty response for fire-and-forget RPCs.
No fields.
RaftPayload
Opaque payload containing msgpack-serialized openraft types.
| Field | Type | Description |
|---|---|---|
data | bytes | The msgpack-serialized consensus message named by the RPC (request on the way in, response on the way out). Produced and read by the engine only. |
group | uint64 | The consensus group the message belongs to. A server hosts replicas of several groups over one connection per peer, and dispatches a request to its replica of this group; a request for a group the server does not host is refused with NOT_FOUND. Set by the sender on every request, including each message of a stream, which must all name the same group. Must equal the group named by the call's version record. Responses echo the request's group. |
