photoncloud-monorepo/flaredb/specs/002-raft-features/contracts/raft-service.md
centra 8f94aee1fa Fix R8: Convert submodule gitlinks to regular directories
- Remove gitlinks (160000 mode) for chainfire, flaredb, iam
- Add workspace contents as regular tracked files
- Update flake.nix to use simple paths instead of builtins.fetchGit

This resolves the nix build failure where submodule directories
appeared empty in the nix store.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 16:51:20 +09:00

953 B

Raft Service Contract (gRPC)

Overview

Single RPC entrypoint for Raft message exchange; uses raft-rs Message protobuf encoding (prost).

Service

service RaftService {
  rpc Send(RaftMessage) returns (RaftResponse);
}

Messages

  • RaftMessage

    • message: bytes (serialized raft::eraftpb::Message via prost)
  • RaftResponse

    • Empty payload; errors conveyed via gRPC status

Expectations

  • Client (peer) wraps raft-rs Message and posts to remote peer via Send.
  • Receivers decode and feed into RawNode::step, then drive on_ready to persist/apply.
  • Transport must retry/transient-handle UNAVAILABLE; fail fast on INVALID_ARGUMENT decode errors.

Test Hooks

  • Integration harness should:
    • Start 3 peers with distinct addresses.
    • Wire RaftService between peers.
    • Propose on leader; verify followers receive and persist entries.
    • Simulate follower stop/restart and verify catch-up via Send.