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

databendlabs / openraft / 20272458143
88%

Build:
DEFAULT BRANCH: main
Ran 16 Dec 2025 03:06PM UTC
Jobs 1
Files 235
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

16 Dec 2025 02:54PM UTC coverage: 92.751% (+0.02%) from 92.736%
20272458143

push

github

drmingdrmer
refactor: add `StreamId` for unique replication stream identification

This change introduces `StreamId` and `SharedIdGenerator` to uniquely identify
replication streams, replacing the previous session-based identification.
Adds `CloseReplicationStreams` command variant for when there are no replication
targets, and adds `leader_vote` field to `RebuildReplicationStreams` and
`ReplicateSnapshot` commands for proper leader identification.

Why:

Before this commit, we used a replication session ID to determine if a
notification message is valid. With this approach, when the membership changes
(e.g., a new membership is appended to the local log), the replication session
ID changes, causing all ongoing replication notifications to be considered
invalid.

This approach is too aggressive - it invalidates notifications that are actually
still valid. For example, if the membership changes from {1,2,3} to {1,2,3,4},
ongoing replication to node 2 or node 3 is still valid because these nodes
remain unchanged in the new membership. But before this commit, these
notifications were simply discarded.

This resulted in fake message loss: valid notification messages were discarded,
causing some tests to fail spuriously.

With this commit, we switch to a new approach: instead of using leader vote and
membership ID to identify notification validity, we assign a unique `StreamId`
to each replication stream. For example, replication to node 2 has a unique
stream ID. As long as this node is present in the membership configuration, the
stream ID remains valid. With this new approach, notification messages won't be
discarded even during membership changes, eliminating the spurious test
failures.

347 of 356 new or added lines in 28 files covered. (97.47%)

10 existing lines in 6 files now uncovered.

14803 of 15960 relevant lines covered (92.75%)

151821.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
90.33
0.04% openraft/src/core/raft_core.rs
2
78.57
-0.04% openraft/src/engine/command.rs
2
0.0
0.0% openraft/src/replication/replication_context.rs
3
66.67
openraft/src/progress/stream_id.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
78.57
-0.04% openraft/src/engine/command.rs
1
83.33
0.0% openraft/src/metrics/serde_instant.rs
1
82.98
-0.35% openraft/src/replication/snapshot_transmitter.rs
2
96.86
-0.92% openraft/src/replication/mod.rs
2
93.04
-1.74% openraft/src/replication/stream_state.rs
3
90.77
-4.62% openraft/src/raft/raft_inner.rs
Jobs
ID Job ID Ran Files Coverage
1 20272458143.1 16 Dec 2025 03:06PM UTC 235
92.75
GitHub Action Run
Source Files on build 20272458143
  • Tree
  • List 235
  • Changed 32
  • Source Changed 30
  • Coverage Changed 31
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20272458143
  • cf3bd063 on github
  • Prev Build on main (#20238889404)
  • Next Build on main (#20295150897)
  • 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