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

databendlabs / openraft
87%

Build:
DEFAULT BRANCH: main
Repo Added 15 Oct 2024 03:30AM UTC
Token P5ILmy9rYJlcs7uJCddenHVVu1Bywo1mI regen
Build 437 Last
Files 264
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH main
branch: SELECT
CHANGE BRANCH
x
Sync Branches
  • No branch selected
  • main
  • release-0.10
  • release-0.9

07 May 2026 10:57AM UTC coverage: 86.679% (+0.05%) from 86.626%
25491647501

push

github

drmingdrmer
fix: client_api: ensure_linearizable_read must respect transfer_to

# Summary

Replace `try_leader_handler` with `ensure_writable_leader_handler` at
the top of `handle_ensure_linearizable_read`. The read path now returns
`ForwardToLeader(target)` when `transfer_to` is set, mirroring the
write path. Fixes #1747.

# Details

Before this change, the only gate on the read path was "am I a
leader?". The write path had a stricter "am I a *writable* leader?"
gate that also checks `transfer_to`. The asymmetry caused two bugs:

- `ReadIndex` on the source emits AppendEntries that bump follower
  `last_update` regardless of lease state. Under sustained reads, the
  cluster could not recover from a transfer if the target was
  unreachable -- followers never election-time-out, so no new leader
  was established.
- `LeaseRead` short-circuits on `last_quorum_acked + leader_lease`,
  which `transfer_leader` does not clear. The source kept serving
  cached reads while a new leader could already be committing fresh
  entries -- a stale read.

Both paths now go through the same gate. `ensure_writable_leader_handler`
returns `ForwardToLeader(target)` when transfer is in progress; the
existing `tx.send(Err(forward.into()))` path propagates that to the
client unchanged.

The two reproducer tests added in the previous commit now pass:

- `transfer_leader_with_dead_target_does_not_block_election` --
  the cluster recovers (n2 elects) within `5 * election_timeout_max`,
  because n0 stops emitting AppendEntries for reads.
- `transfer_leader_blocks_lease_read` -- LeaseRead returns
  `ForwardToLeader(target)` immediately; no stale-read window.

- Fix: #1747

16332 of 18842 relevant lines covered (86.68%)

145287.39 hits per line

Relevant lines Covered
Build:
Build:
18842 RELEVANT LINES 16332 COVERED LINES
145287.39 HITS PER LINE
Source Files on main
  • Tree
  • List 264
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
25491647501 main fix: client_api: ensure_linearizable_read must respect transfer_to # Summary Replace `try_leader_handler` with `ensure_writable_leader_handler` at the top of `handle_ensure_linearizable_read`. The read path now returns `ForwardToLeader(target)` ... push 07 May 2026 11:01AM UTC drmingdrmer github
86.68
25206429598 main docs: add recipe for fully removing a retained learner `change_membership(..., retain=true)` only demotes a voter — the demoted node stays in membership as a learner and keeps receiving log replication. The existing docs describe this behavior bu... push 01 May 2026 07:26AM UTC drmingdrmer github
86.63
25205936683 main refactor: config: split clap parsing and RuntimeConfig into separate files `config.rs` mixed three concerns: the `Config` struct itself, the `RuntimeConfig` runtime-mutable subset, and clap-driven CLI parsing (`parse_bytes_with_unit`, `parse_snap... push 01 May 2026 07:07AM UTC drmingdrmer github
86.57
25174421022 main chore: bump version to 0.10.0-alpha.20 push 30 Apr 2026 03:36PM UTC drmingdrmer github
86.53
25173291568 release-0.10 feat: config: make clap dependency optional Move `clap` and `byte-unit` behind a new `clap` feature flag (kept in `default = [...]` for backward compatibility). Library users who never parse `Config` from CLI args can opt out and drop both depend... push 30 Apr 2026 03:14PM UTC drmingdrmer github
86.57
25172785578 main feat: config: make clap dependency optional Move `clap` and `byte-unit` behind a new `clap` feature flag (kept in `default = [...]` for backward compatibility). Library users who never parse `Config` from CLI args can opt out and drop both depend... push 30 Apr 2026 03:05PM UTC drmingdrmer github
86.55
25041077250 main test: turmoil: route openraft RNG and spawn through DeterministicRng Override `AsyncRuntime` in the test's `TypeConfig` so openraft's internal `thread_rng()` and `spawn` honor the per-host deterministic seed already set up by `cluster.rs`. `decl... push 28 Apr 2026 08:04AM UTC drmingdrmer github
86.58
24997322737 main docs: clarify RaftNetworkV2 design and streaming options Make explicit that `RaftNetworkV2` is designed for unary request-response RPCs and document the three paths to stream-oriented AppendEntries, so implementers can pick the right level of eff... push 27 Apr 2026 01:22PM UTC drmingdrmer github
86.56
24774202633 main docs: expand "differences from standard Raft" FAQ entry Turn the 5-line bullet list into a grouped, protocol-level survey of where Openraft departs from the Raft paper. The previous entry only listed five items and left several other departures (... push 22 Apr 2026 10:51AM UTC drmingdrmer github
86.55
24767444392 main test: detsim: Drop stale raft handles on crash push 22 Apr 2026 08:09AM UTC drmingdrmer github
86.56
See All Builds (437)

Badge your Repo: openraft

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
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