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

databendlabs / openraft / 27423417226
87%

Build:
DEFAULT BRANCH: main
Ran 12 Jun 2026 02:54PM UTC
Jobs 1
Files 264
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

12 Jun 2026 02:47PM UTC coverage: 86.624% (-0.02%) from 86.642%
27423417226

push

github

drmingdrmer
feat: add Pre-Vote to avoid disruptive term inflation

# Summary

A follower probes whether a quorum would grant its vote at the next term
before persisting a vote or bumping its term, so a node that cannot
currently win -- partitioned, restarted, or with a stale log -- does not
inflate the cluster term and disrupt a healthy leader on reconnect.

# Details

- Config::enable_pre_vote: Option<bool> gates the automatic round on election
  timeout. None, the default, is treated as disabled, leaving room to change
  the default later without breaking existing configs.

- Trigger::elect now takes pre_vote: bool, so an operator can run a cautious
  manual election independent of the config; existing callers pass false.

- New RaftNetworkV2::pre_vote RPC. The default impl grants unconditionally so
  a cluster mid-upgrade stays live, and a transport error is never counted as
  a grant, so an isolated node cannot synthesize a quorum.

- Engine pre_elect / handle_pre_vote_req / handle_pre_vote_resp run the round
  without persisting a vote or changing server state; a would-grant quorum
  starts the real election, and a real election or a higher accepted vote
  supersedes an in-flight round.

- Fix: #1770

220 of 244 new or added lines in 20 files covered. (90.16%)

7 existing lines in 3 files now uncovered.

16702 of 19281 relevant lines covered (86.62%)

147614.35 hits per line

Uncovered Changes

Lines Coverage ∆ File
8
97.19
-1.37% openraft/src/engine/engine_impl.rs
5
92.09
0.04% openraft/src/core/raft_core.rs
3
60.0
-15.0% openraft/src/raft/runtime_config_handle.rs
2
89.09
-2.91% openraft/src/network/v2/network.rs
2
0.0
openraft/src/network/vote_trait.rs
1
52.94
-0.18% openraft/src/core/notification_name.rs
1
52.63
-0.07% openraft/src/core/raft_msg/raft_msg_name.rs
1
79.9
0.0% openraft/src/engine/command.rs
1
96.76
-0.51% openraft/src/engine/command_name.rs

Coverage Regressions

Lines Coverage ∆ File
3
84.62
-4.62% openraft/src/raft/raft_inner.rs
2
92.59
-7.41% openraft/src/core/sm/handle.rs
2
93.28
-1.68% openraft/src/replication/stream_state.rs
Jobs
ID Job ID Ran Files Coverage
1 27423417226.1 12 Jun 2026 02:54PM UTC 264
86.62
GitHub Action Run
Source Files on build 27423417226
  • Tree
  • List 264
  • Changed 22
  • Source Changed 19
  • Coverage Changed 22
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #27423417226
  • 0f6bb9a3 on github
  • Prev Build on main (#27400130554)
  • Next Build on main (#27595431475)
  • 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