Skip to content

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.

Methods

Vote

Leader election vote (unary). Payload: msgpack(VoteRequest) → msgpack(VoteResponse)

Request: RaftPayload

FieldTypeDescription
databytes

Response: RaftPayload

FieldTypeDescription
databytes

AppendEntries

Log replication (unary, single batch). Used as fallback when streaming is not available. Payload: msgpack(AppendEntriesRequest) → msgpack(AppendEntriesResponse)

Request: RaftPayload

FieldTypeDescription
databytes

Response: RaftPayload

FieldTypeDescription
databytes

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

FieldTypeDescription
databytes

Response: stream RaftPayload

FieldTypeDescription
databytes

Snapshot

Snapshot transfer (client streaming). Leader streams snapshot chunks, follower responds with ack.

Request: stream RaftPayload

FieldTypeDescription
databytes

Response: RaftPayload

FieldTypeDescription
databytes

TransferLeader

Leadership transfer (unary).

Request: RaftPayload

FieldTypeDescription
databytes

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.

FieldTypeDescription
databytes