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

databendlabs / openraft / 15554805458
88%
main: 88%

Build:
Build:
LAST BUILD BRANCH: release-0.10
DEFAULT BRANCH: main
Ran 10 Jun 2025 08:47AM UTC
Jobs 1
Files 193
Run time 2min
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

10 Jun 2025 08:22AM UTC coverage: 91.035% (+0.7%) from 90.365%
15554805458

push

github

drmingdrmer
refactor: tolerate leader state reversion upon restart

When a leader restarted and its log reverted, and tried to re-elect
itself as leader:

And when vote request is rejected and see a greater vote,
it should only update to the non-committed version of the responded vote
to its local state:

This prevents a dangerous scenario when state reversion is allowed:
1. A node was a leader but its state reverted to a previous version;
2. The node restarts and begins election;
3. It receives a vote response containing its own previous leader vote;
4. Without this protection, it would update to that committed vote and
   become leader again;
5. However, it lacks the necessary logs, causing committed entries to be
   lost or inconsistent;

By using the non-committed version, we prevent this reverted node from
becoming leader while still allowing proper vote updates for legitimate
cases.

2 of 2 new or added lines in 1 file covered. (100.0%)

46 existing lines in 8 files now uncovered.

11170 of 12270 relevant lines covered (91.04%)

88167.61 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
99.47
-0.53% openraft/src/engine/handler/following_handler/mod.rs
1
96.83
0.67% openraft/src/engine/handler/leader_handler/mod.rs
2
97.43
2.46% openraft/src/engine/engine_impl.rs
3
98.06
0.28% openraft/src/engine/handler/replication_handler/mod.rs
5
94.92
-1.48% openraft/src/raft/mod.rs
7
81.38
7.33% openraft/src/replication/mod.rs
10
80.28
0.28% openraft/src/metrics/wait.rs
17
87.28
7.06% openraft/src/core/raft_core.rs
Jobs
ID Job ID Ran Files Coverage
1 15554805458.1 10 Jun 2025 08:47AM UTC 193
91.04
GitHub Action Run
Source Files on build 15554805458
  • Tree
  • List 193
  • Changed 18
  • Source Changed 2
  • Coverage Changed 18
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15554805458
  • b262f054 on github
  • Prev Build on main (#15406793779)
  • Next Build on release-0.10 (#15557612091)
  • 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