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

bedrock-kv / bedrock / 88fdb108976fad36cb3543603a24f670a938959a-PR-329
82%
develop: 82%

Build:
Build:
LAST BUILD BRANCH: bedrock-5yi/election-flapping
DEFAULT BRANCH: develop
Ran 14 Sep 2026 08:55PM UTC
Jobs 1
Files 216
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

14 Sep 2026 08:53PM UTC coverage: 81.654% (-0.007%) from 81.661%
88fdb108976fad36cb3543603a24f670a938959a-PR-329

Pull #329

github

jallum
bedrock-5yi: Size the coordinator election timeout to the raft heartbeat cadence

Coordinator leadership flapped (roughly one election a second) whenever the
BEAM was under load, most visibly while a coordinator was down and each new
leader's recovery stalled.

bedrock_raft's leader skips a follower it heard from within heartbeat_ms, so
a healthy follower receives AppendEntries every 2 * heartbeat_ms (200ms,
measured on the harness), and a new leader's first AppendEntries can take as
long. The election timeout was 250-350ms: 50ms of slack. Under load a raft
round-trip through the coordinator's DETS log took 50-200ms, stretching
heartbeat gaps to 230-300ms. Of 84 candidacies logged during natural storms
on the harness, 64 fired 254-357ms after the follower's last AppendEntries.
Suspending the leader's coordinator for 150ms started an election in 2-3 of
8 trials; with the timeout below, 0 of 8.

A follower now waits (T, 2T] with T = 5 * heartbeat_ms: the window the
leader itself allows before stepping down when it hears from no quorum of
followers (bedrock_raft's quorum check). The two sides now agree on how long
silence means lost leadership, and a follower tolerates about 300ms of
latency beyond the heartbeat cadence. Failover and single-node boot wait
about 150-650ms longer (501-1000ms instead of 251-350ms).
Pull Request #329: bedrock-5yi: stop stale and too-short election timers from deposing healthy coordinator leaders

8 of 9 new or added lines in 1 file covered. (88.89%)

4 existing lines in 1 file now uncovered.

7188 of 8803 relevant lines covered (81.65%)

1140.97 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
95.0
11.67% lib/bedrock/control_plane/coordinator/raft_adapter.ex

Coverage Regressions

Lines Coverage ∆ File
4
68.97
-4.6% lib/bedrock/data_plane/resolver/tree.ex
Jobs
ID Job ID Ran Files Coverage
1 88fdb108976fad36cb3543603a24f670a938959a-PR-329.1 14 Sep 2026 08:55PM UTC 216
81.65
GitHub Action Run
Source Files on build 88fdb108976fad36cb3543603a24f670a938959a-PR-329
  • Tree
  • List 216
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #329
  • PR Base - develop (#153A2B62...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc