- 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.5 KiB
1.5 KiB
Quickstart: Multi-Raft (Static → Split → Move)
Prerequisites
- Nix or Rust toolchain per repo.
- PD stub runs inline (tests use in-memory).
Run tests (recommended)
nix develop -c cargo test -q rdb-server::tests::test_multi_region
nix develop -c cargo test -q rdb-server::tests::test_split
nix develop -c cargo test -q rdb-server::tests::test_confchange_move
Or full suite:
nix develop -c cargo test -q
Manual smoke (single node, two regions)
- Launch PD stub (or ensure
pdpbgRPC reachable). - Start server:
nix develop -c cargo run -p rdb-server -- --pd-endpoint http://127.0.0.1:50051 - Verify routing:
- Put key
b"a"→ Region1 - Put key
b"z"→ Region2
- Put key
Trigger split (dev)
- Run
test_splitor fill a region with writes. - Observe log:
ApplyCommand::Splitand new region registered.
Move (rebalance) flow (simplified)
- Source store handles region; target store starts with PD meta.
- PD issues
MoveRegion(region_id, from=src, to=dst). - Source adds replica on target (ConfChange Add); target catches up; source can later remove itself (ConfChange Remove).
- Verify data on target:
nix develop -c cargo test -q move_region_replica_carries_data -- --nocapture
Notes
- Key ranges must not overlap; nodes validate PD meta.
- Raft logs and hard-state are prefixed by
region_idto isolate shards. - Pending eventual writes are forwarded to leaders; local queue persists to disk to survive restart.