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

databendlabs / openraft / 15236981491
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: release-0.10
DEFAULT BRANCH: main
Ran 25 May 2025 10:40AM UTC
Jobs 1
Files 191
Run time 1min
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

25 May 2025 05:51AM UTC coverage: 90.358% (-0.07%) from 90.427%
15236981491

push

github

drmingdrmer
feat: add `Raft::get_read_linearizer()`

Add new API `Raft::get_read_linearizer()` to implement linearizable
reads. It provides a clearer API and gives users intuitive guidance
on how to perform local linearizable reads or follower reads, i.e.,
get `read_log_id` from a remote leader but read the local state machine.

`Raft::get_read_linearizer()` ensures leadership and returns a
`Linearizer` instance containing `read_log_id` and the last `applied`
log ID in the state machine. The caller, either on the local node or on
a remote follower, calls `Linearizer::await_applied()` to block until
the state machine applies up to `read_log_id` to assert linearizability.

A typical usage of follower read:

```rust,ignore
// Application defined RPC to get the `read_log_id` from the remote leader
let leader_id = my_raft.current_leader().await?.unwrap();
let linearizer = my_app_rpc.get_read_linearizer(leader_id, ReadPolicy::ReadIndex).await?;

// Block waiting local state machine to apply up to the `read_log_id`
let _ = linearizer.await_applied(&my_raft, None).await?.unwrap();

// Following read from state machine is linearized across the cluster
let val = my_raft.with_state_machine(|sm| { sm.read("foo") }).await?;
```

63 of 79 new or added lines in 7 files covered. (79.75%)

1 existing line in 1 file now uncovered.

9840 of 10890 relevant lines covered (90.36%)

97687.84 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
96.15
-3.85% openraft/src/engine/handler/leader_handler/mod.rs
15
51.61
openraft/src/raft/linearizable_read/linearizer.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
74.05
-0.63% openraft/src/replication/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 15236981491.1 25 May 2025 10:40AM UTC 191
90.36
GitHub Action Run
Source Files on build 15236981491
  • Tree
  • List 191
  • Changed 10
  • Source Changed 9
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15236981491
  • 467ffaa7 on github
  • Prev Build on release-0.10 (#15074256140)
  • Next Build on release-0.10 (#15237453184)
  • Delete
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