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

pomerium / pomerium / 17806046267
52%

Build:
DEFAULT BRANCH: main
Ran 17 Sep 2025 05:54PM UTC
Jobs 1
Files 569
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

17 Sep 2025 05:43PM UTC coverage: 53.803% (-0.2%) from 54.044%
17806046267

push

github

web-flow
databroker: add raft leader elector (#5831)

## Summary
Add a leader elector for the clustered databroker using Raft.

We use the hashicorp/raft package. It requires several components:

* **FSM**: just ignores all changes
* **Log Store**: stores all logs in in-memory btree ordered by index
* **Snapshot Store**: discards all snapshots
* **Stable Store**: stores data in in-memory maps
* **Stream Layer**: creates TCP listeners/connections based on the
`databroker_raft_bind_address` and `raft_address` in
`databroker_cluster_nodes`. Communication is encrypted using TLS with
certificates derived from the shared key.
* **Transport**: uses a network stream with the stream layer described
above. The other settings were copied from vault.

The raft leader elector will be used if no explicit cluster leader is
defined and the `databroker_raft_bind_address` is set. If raft options
aren't set, we will pick the first node as the cluster leader.

## Related issues
-
[ENG-2724](https://linear.app/pomerium/issue/ENG-2724/databroker-implement-leader-election)


## Checklist

- [x] reference any related issues
- [x] updated unit tests
- [x] add appropriate label (`enhancement`, `bug`, `breaking`,
`dependencies`, `ci`)
- [x] ready for review

74 of 368 new or added lines in 10 files covered. (20.11%)

14 existing lines in 6 files now uncovered.

27006 of 50194 relevant lines covered (53.8%)

87.23 hits per line

Uncovered Changes

Lines Coverage ∆ File
76
0.0
0.0% internal/databroker/leader_elector.go
50
0.0
internal/databroker/raft/log_store.go
50
59.68
internal/databroker/raft/stream_layer.go
34
0.0
internal/databroker/raft/node.go
34
0.0
internal/databroker/raft/stable_store.go
25
0.0
internal/databroker/raft/fsm.go
12
0.0
0.0% internal/databroker/server_clustered.go
9
0.0
internal/databroker/raft/transport.go
3
0.0
internal/databroker/raft/snapshot_store.go
1
93.69
0.0% config/options_databroker.go

Coverage Regressions

Lines Coverage ∆ File
4
90.91
0.0% pkg/fanout/receive.go
3
87.75
-1.47% config/config_source.go
2
65.0
-0.53% internal/databroker/server_clustered_follower.go
2
89.19
-5.41% pkg/fanout/fanout.go
2
87.14
0.0% pkg/storage/postgres/postgres.go
1
0.0
0.0% internal/databroker/server_clustered.go
Jobs
ID Job ID Ran Files Coverage
1 17806046267.1 17 Sep 2025 05:54PM UTC 569
53.8
GitHub Action Run
Source Files on build 17806046267
  • Tree
  • List 569
  • Changed 10
  • Source Changed 3
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #17806046267
  • 452c524e on github
  • Prev Build on main (#17799262244)
  • Next Build on main (#17868785622)
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