Context
The durable state-machine snapshot implementation retains the current snapshot in the state machine and exposes an owned Cursor<Vec<u8>> to OpenRaft. For large completed snapshots, this can mean two in-process payload buffers.
This is not a correctness problem. Snapshot durability, install, restart, and compaction recovery must remain unchanged.
Work
- Benchmark snapshot build allocation, peak RSS, and latency for realistic DB and AI snapshot sizes.
- Benchmark snapshot transfer latency and memory while a leader serves a snapshot to a learner.
- Decide from measurements whether duplicate completed-snapshot buffers are material.
- If warranted, introduce a custom OpenRaft
SnapshotData type with a mutable receive representation for InstallSnapshot and a shared immutable representation for completed snapshots.
- Preserve durable local recovery, installed-snapshot recovery, and chunked transport behavior with targeted tests.
Acceptance Criteria
- Baseline measurements are recorded.
- Any optimization is justified by those measurements.
- Restart-after-compaction and install-then-restart coverage remains intact.
- Snapshot receive/send behavior is tested for partial/chunked transfer.
Context
The durable state-machine snapshot implementation retains the current snapshot in the state machine and exposes an owned
Cursor<Vec<u8>>to OpenRaft. For large completed snapshots, this can mean two in-process payload buffers.This is not a correctness problem. Snapshot durability, install, restart, and compaction recovery must remain unchanged.
Work
SnapshotDatatype with a mutable receive representation forInstallSnapshotand a shared immutable representation for completed snapshots.Acceptance Criteria