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

databendlabs / openraft / 20678346716
88%

Build:
DEFAULT BRANCH: main
Ran 03 Jan 2026 02:11PM UTC
Jobs 1
Files 258
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

03 Jan 2026 02:00PM UTC coverage: 87.534% (-0.001%) from 87.535%
20678346716

push

github

drmingdrmer
change: replace `RaftLogStorage::truncate()` with `truncate_after()`

Replace the `truncate()` method with `truncate_after()` in the `RaftLogStorage`
trait to provide clearer log truncation semantics. The new method takes
`Option<LogId>` and keeps logs up to and including the given log id.

Changes:
- Replace `truncate()` with `truncate_after()` in `RaftLogStorage` trait
- Update all store implementations to use the new method
- Update internal raft_core to use `truncate_after()`
- Add `delete_logs_after_5` test for mid-log truncation coverage

Upgrade tip:

If you implement `RaftLogStorage`, replace your `truncate()` implementation
with `truncate_after()`. The key semantic difference:

- `truncate(log_id)`: deleted logs from `log_id.index()` onwards (inclusive)
- `truncate_after(last_log_id)`: deletes logs after `last_log_id` (exclusive)

Update your implementation:
```rust
// Before:
async fn truncate(&mut self, log_id: LogId) -> Result<(), io::Error> {
    delete_from(log_id.index()..);
}

// After:
async fn truncate_after(&mut self, last_log_id: Option<LogId>) -> Result<(), io::Error> {
    let start = last_log_id.map(|id| id.index() + 1).unwrap_or(0);
    delete_from(start..);
}
```

72 of 72 new or added lines in 8 files covered. (100.0%)

6 existing lines in 2 files now uncovered.

15574 of 17792 relevant lines covered (87.53%)

160109.77 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
3
95.65
-3.26% openraft/src/core/heartbeat/worker.rs
3
91.82
-0.35% openraft/src/core/raft_core.rs
Jobs
ID Job ID Ran Files Coverage
1 20678346716.1 03 Jan 2026 02:11PM UTC 258
87.53
GitHub Action Run
Source Files on build 20678346716
  • Tree
  • List 258
  • Changed 11
  • Source Changed 10
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20678346716
  • a86e6e75 on github
  • Prev Build on main (#20674731320)
  • Next Build on main (#20679123990)
  • 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