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

databendlabs / openraft / 18818196199
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: release-0.10
DEFAULT BRANCH: main
Ran 26 Oct 2025 12:57PM UTC
Jobs 1
Files 207
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

26 Oct 2025 11:01AM UTC coverage: 91.391% (+0.1%) from 91.246%
18818196199

push

github

drmingdrmer
feat: add I/O flush progress tracking API

Add `watch_log_progress()` and `watch_vote_progress()` APIs to track
when Raft I/O operations are durably written to storage.

The implementation provides two independent progress streams:

- Log progress: Tracks all I/O operations (vote saves and log appends).
  Returns `FlushPoint` containing the vote and last log ID.

- Vote progress: Tracks only vote changes (new term or leader).
  Returns the flushed `Vote`.

Both APIs expose a `WatchProgress` handle with:
- `get()`: Get current progress state immediately
- `wait_until_ge()`: Wait asynchronously until progress reaches threshold

Additionally, add `wait_until()` method to `WatchReceiver` trait that
accepts a closure for custom conditions, complementing `wait_until_ge()`.

Example usage:

```rust
// Wait for a specific log entry to be flushed
let mut log_progress = raft.watch_log_progress();
let target = Some(FlushPoint::new(
    Vote::new_committed(2, node_id),
    Some(LogId::new(LeaderId::new(2, node_id), 100))
));
log_progress.wait_until_ge(&target).await?;
// Now log entry 100 is guaranteed durable

// Track leadership changes
let mut vote_progress = raft.watch_vote_progress();
let current = vote_progress.get();  // Get current vote immediately
let target = Some(Vote::new_committed(3, 0));
vote_progress.wait_until_ge(&target).await?;
// Now term 3 is guaranteed persisted
```

123 of 127 new or added lines in 14 files covered. (96.85%)

1 existing line in 1 file now uncovered.

12176 of 13323 relevant lines covered (91.39%)

141862.13 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
81.48
-14.17% openraft/src/vote/ref_vote.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
82.09
0.0% openraft/src/metrics/serde_instant.rs
Jobs
ID Job ID Ran Files Coverage
1 18818196199.1 26 Oct 2025 12:57PM UTC 207
91.39
GitHub Action Run
Source Files on build 18818196199
  • Tree
  • List 207
  • Changed 14
  • Source Changed 11
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18818196199
  • cddefbd7 on github
  • Prev Build on main (#18816960782)
  • Next Build on release-0.10 (#18819965420)
  • 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