- 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>
1.7 KiB
1.7 KiB
Data Model: Raft Core Replication
Entities
-
Peer
- Fields:
id (u64),region_id (u64),state (Leader/Follower/Candidate),term (u64),commit_index (u64),last_applied (u64) - Relationships: owns
RaftStorage; exchangesRaftLogEntrywith other peers. - Constraints: single region scope for this phase; fixed voter set of 3.
- Fields:
-
RaftLogEntry
- Fields:
index (u64),term (u64),command (bytes),context (bytes, optional) - Relationships: persisted in
raft_logCF; applied to state machine when committed. - Constraints: indices strictly increasing; term monotonic per election; applied in order.
- Fields:
-
HardState
- Fields:
current_term (u64),voted_for (u64),commit_index (u64) - Relationships: persisted in
raft_stateCF; loaded at startup before participating. - Constraints: must be flushed atomically with log appends when advancing commit index.
- Fields:
-
ConfState
- Fields:
voters (Vec<u64>) - Relationships: persisted in
raft_stateCF; defines quorum (majority of 3). - Constraints: static for this phase; changes require future joint consensus.
- Fields:
-
ReplicationState
- Fields:
match_index (u64),next_index (u64),pending (bool) - Relationships: maintained per follower in memory; not persisted.
- Constraints: drives AppendEntries backoff and progress.
- Fields:
State Transitions
- Peer transitions: Follower → Candidate → Leader on election; Leader → Follower on higher term or failed election.
- Log application: when
commit_indexadvances, apply entries in order to state machine;last_appliedincreases monotonically. - Recovery: on restart, load
HardState,ConfState, and log; reconcile with leader via AppendEntries (truncate/append) before applying new entries.