• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

databendlabs / openraft / 27595431475

16 Jun 2026 05:01AM UTC coverage: 86.754% (+0.1%) from 86.624%
27595431475

push

github

drmingdrmer
docs: explain committed recovery and Raft::wait_for_recovery

# Summary

Document what happens to the state machine across a restart when `committed`
is not persisted, and how to recover deterministically. The earlier text
assumed a restarted leader rebroadcasts its restored (possibly stale) commit;
that is no longer how the leader behaves, so the explanation is reframed around
the cluster commit as a quorum-established, never-restored recovery signal, and
points to `wait_for_recovery` as the way to wait for recovery on startup.

# Details

- Reframe the reverted-read-on-restart explanation in `log_pointers` and on
  `RaftLogStorage::save_committed`: a node that did not persist `committed`
  recovers only to its last snapshot until it perceives the re-established
  cluster commit and re-applies up to it. Correct the now-false claim that a
  restarted leader broadcasts a stale smaller commit and that waiting for a
  commit message is insufficient. Cross-link `docs::protocol::read` and
  `docs::protocol::commit`.
- Expand `Raft::wait_for_recovery` docs with why it is sound (the `read_log_id`
  argument) and a usage-scope note: call it once after creation to cross a
  restart, not as a per-read primitive — use `ensure_linearizable` for reads.
- Add a "recovering committed state on startup" section to `Raft::new`, and a
  `new` + `wait_for_recovery` snippet at each mention site.

16741 of 19297 relevant lines covered (86.75%)

162688.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.74
/openraft/src/engine/handler/replication_handler/mod.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc