photoncloud-monorepo/specifications/flaredb/003-kvs-consistency/contracts/raft_service.md

33 lines
925 B
Markdown

# RaftService contracts (namespace mode ops)
## GetMode
- **RPC**: `RaftService/GetMode`
- **Request**: `namespace: string` (empty => `default`)
- **Response**: `mode: string` (`"strong"` or `"eventual"`)
## UpdateNamespaceMode
- **RPC**: `RaftService/UpdateNamespaceMode`
- **Request**:
- `namespace: string` (required)
- `mode: string` (`"strong"` or `"eventual"`, required)
- **Response**: `mode` object
- `namespace: string`
- `id: uint32`
- `mode: string`
- `from_default: bool` (true if created implicitly)
## ListNamespaceModes
- **RPC**: `RaftService/ListNamespaceModes`
- **Request**: empty
- **Response**: `namespaces[]`
- `namespace: string`
- `id: uint32`
- `mode: string`
- `from_default: bool`
### Error cases
- `InvalidArgument` when mode is not `"strong"` or `"eventual"` or namespace is empty for updates.
- `FailedPrecondition` if Raft messages are addressed to a different peer.